Base module for Brighter Planet's emitters. See the Brighter Planet developer page for details on Brighter Planet's development environment.
$ gem install emitter
# my_emitter.rb require 'emitter' class MyEmitter include BrighterPlanet::Emitter end
Your emitter must define some modules under
lib/my_emitter/, they are:
module MyEmitter::ImpactModel- defines the Leap decisions that calculate an impact.
module MyEmitter::Characterization- defines the Characteristics that describe the model's inputs.
module MyEmitter::Data- defines the schema definitions for the emitter and DataMiner processes that fetch and store data for the emitter.
module MyEmitter::Relationships- defines the ActiveRecord relationships between the emitter and other Earth models.
moduel MyEmitter::Summarization- defines phrases that describe various attributes (SummaryJudgement descriptors) about an emitter that are displayed on CM1's methodology pages.
You can use the bp gem to generate the skeleton for a new emitter.
Emitter, once included, will perform a couple tasks automatically:
- It converts committees into characterizations that are not already characterized.
- It adds
run_data_miner_on_parent_associations!tasks to DataMiner so that a call to
MyEmitter.run_data_miner!will update the emitter's schema and run DataMiner tasks on any belongs_to associations.
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so I don't break it in a future version unintentionally.
- Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
- Send me a pull request. Bonus points for topic branches.
Copyright 2010, 2011 Brighter Planet, Inc. See LICENSE and LICENSE-PREAMBLE for details.