GithubHelp home page GithubHelp logo

bbc / alephant Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 2.0 276 KB

The Alephant framework is a collection of isolated Ruby gems, which interconnect to offer powerful message passing functionality built up around the "Broker" pattern.

License: MIT License

Ruby 98.17% HTML 1.83%

alephant's People

Contributors

dazoakley avatar guntrisoft avatar integralist avatar kenoir avatar samfrench avatar stevenjack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alephant's Issues

Publisher gem is now deprecated

The publisher functionality has been split into two separate gems now:

  1. alephant-publisher-queue
  2. alephant-publisher-request

We've since marked the original Publisher gem as being deprecated, but the code in this repo still loads that gem instead of the alephant-publisher-queue gem (which is the default functionality).

We should update this gem to pull in alephant-publisher-queue

Make partials work in Alephant

We'd like to include common mustache templates using mustache partials.

Currently by default it will look for partials in the current directory, but as we have different queues in the election data renderer project it's not possible to store them in the same directory.

We have got around this issue by setting the following in our view model:

self.template_path = File.dirname(__FILE__) + '/../../lib/templates/'

It would be nice for this to be set somewhere in Alephant::Views::Base - however the only caveat with that, is that '/../../lib/templates/' is very specific to the election data renderer project.

Perhaps we can call a static method on Alephant::Views::Base from the election data renderer project which sets a path for partials?

Sequencer fallback for table_name or raise an error?

I wasn't able to add this issue to the BBC Alephant repo as that repo is forked from this one.


https://github.com/BBC-News/alephant/blob/master/lib/alephant.rb

def initialize(opts = {})
  @sequencer = Sequencer.new(
  {
    :table_name => @table_name
  },
  @sqs_queue_id
  )
end

It seems that if table_name is not provided then the attr_accessor for table_name wont be created and so I'm not sure what value is passed to Sequencer? I assume Nil.

We need to provide a fallback in case the user doesn't supply the required values for each of the model components.

RSpec terminology/syntax

Just having a quick re-read of "The RSpec Book" and it seems that some of the test code that caused me a bit of confusion might not have if a clearer syntax was used.

double(), stub() and mock() are all effectively the same (they all create an instance of a MockClass).

The reason they exist is to indicate the different intent (rather than using double all the time).

Example give in the book was...

describe Statement do
  it "logs a message on generate()" do
    customer = stub('customer')
    customer.stub(:name).and_return('Aslak')
    logger = mock('logger')
    statement = Statement.new(customer, logger)
    logger.should_receive(:log).with(/Statement generated for Aslak/)
    statement.generate
  end
end

We know the stub method should be used on a Stub and the should_receive should be used on a Mock.

Admittedly that has made the existing code become clearer. But I like the idea of code having clear intention through better terminology.

Thoughts?

Consistent license

Seems the Alephant gem has a license of GPLv3 (GNU GENERAL PUBLIC LICENSE), where some of the other Alephant gems are MIT

This needs to be consistent across all gems.

The difference (as far as I'm aware) is that with the MIT license you're letting all users know that they can modify the code and redistribute it as long as the original authors information is included in that distribution.

I'm not sure if the GNU license enforces a similar principle or not?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.