Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 51 lines (33 sloc) 2.537 kb
e94c3e1 Derek Kastner Improved documentation
dkastner authored
1 # emitter
2
3 Base module for Brighter Planet's emitters. See the [Brighter Planet developer page](http://brighterplanet.github.com) for details on Brighter Planet's development environment.
4
5 ## Installation
6
7 $ gem install emitter
8
9 ## Usage
10
11 # my_emitter.rb
12 require 'emitter'
13
14 class MyEmitter
15 include BrighterPlanet::Emitter
16 end
17
18 ### Required modules
19
20 Your emitter must define some modules under `lib/my_emitter/`, they are:
21 * `lib/my_emitter/impact_model.rb` - `module MyEmitter::ImpactModel` - defines the [Leap](http://rubygems.org/gems/leap) decisions that calculate an impact.
22 * `lib/my_emitter/characterization.rb` - `module MyEmitter::Characterization` - defines the [Characteristics](http://rubygems.org/gems/charisma) that describe the model's inputs.
80909dd Derek Kastner Fix links #1
dkastner authored
23 * `lib/my_emitter/data.rb` - `module MyEmitter::Data` - defines the [schema](http://rubygems.org/gems/mini\_record) definitions for the emitter and [DataMiner](http://rubygems.org/gems/data\_miner) processes that fetch and store data for the emitter.
e94c3e1 Derek Kastner Improved documentation
dkastner authored
24 * `lib/my_emitter/relationships.rb` - `module MyEmitter::Relationships` - defines the ActiveRecord relationships between the emitter and other [Earth](http://rubygems.org/gems/earth) models.
80909dd Derek Kastner Fix links #1
dkastner authored
25 * `lib/my_emitter/summarization.rb` - `moduel MyEmitter::Summarization` - defines phrases that describe various attributes ([SummaryJudgement descriptors](http://rubygems.org/gems/summary\_judgement)) about an emitter that are displayed on CM1's methodology pages.
e94c3e1 Derek Kastner Improved documentation
dkastner authored
26
27 ## Tools
28
29 You can use the [bp gem](http://github.com/brighterplanet/bp) to generate the skeleton for a new emitter.
30
51091d8 Derek Kastner Document magic
dkastner authored
31 ## Magic
32
33 Emitter, once included, will perform a couple tasks automatically:
34
35 1. It converts committees into characterizations that are not already characterized.
36 1. It adds `auto_upgrade!` and `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.
37
e94c3e1 Derek Kastner Improved documentation
dkastner authored
38 ## Note on Patches/Pull Requests
39
40 * Fork the project.
41 * Make your feature addition or bug fix.
42 * Add tests for it. This is important so I don't break it in a
43 future version unintentionally.
44 * Commit, do not mess with rakefile, version, or history.
45 (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)
46 * Send me a pull request. Bonus points for topic branches.
47
a8dd9f6 Derek Kastner Missed markdown format conversion
dkastner authored
48 ## Copyright
e94c3e1 Derek Kastner Improved documentation
dkastner authored
49
50 Copyright 2010, 2011 Brighter Planet, Inc. See LICENSE and LICENSE-PREAMBLE for details.
Something went wrong with that request. Please try again.