emitter 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +0 -1
- data/LICENSE-PREAMBLE +4 -3
- data/README.rdoc +2 -2
- data/emitter.gemspec +6 -6
- data/lib/emitter.rb +11 -11
- data/lib/emitter/version.rb +1 -1
- data/spec/emitter_spec.rb +3 -3
- data/spec/fixtures/biplane/lib/biplane/data.rb +3 -5
- data/spec/fixtures/biplane/lib/biplane/{carbon_model.rb → impact_model.rb} +3 -3
- data/spec/fixtures/dirigible/lib/dirigible.rb +1 -1
- data/spec/fixtures/dirigible/lib/dirigible/data.rb +4 -6
- data/spec/fixtures/dirigible/lib/dirigible/{carbon_model.rb → impact_model.rb} +3 -3
- metadata +12 -12
data/Gemfile
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
gem 'sniff', :path => ENV['LOCAL_SNIFF'] if ENV['LOCAL_SNIFF']
|
2
2
|
gem 'data_miner', :path => ENV['LOCAL_DATA_MINER'] if ENV['LOCAL_DATA_MINER']
|
3
3
|
gem 'earth', :path => ENV['LOCAL_EARTH'] if ENV['LOCAL_EARTH']
|
4
|
-
gem 'force_schema', :path => ENV['LOCAL_FORCE_SCHEMA'] if ENV['LOCAL_FORCE_SCHEMA']
|
5
4
|
|
6
5
|
source :rubygems
|
7
6
|
|
data/LICENSE-PREAMBLE
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
BRIGHTER PLANET ADDITIONAL PREAMBLE TO THE GNU AFFERO GENERAL PUBLIC LICENSE
|
2
|
-
|
2
|
+
August 3, 2011
|
3
3
|
|
4
4
|
This preamble is meant to help the licensee understand exactly what
|
5
5
|
software is being received under the license and set expectations as to
|
@@ -37,13 +37,14 @@ This license does not extend to the following:
|
|
37
37
|
license including but not limited to other forms of open source
|
38
38
|
license, commercial license, and the like;
|
39
39
|
|
40
|
-
* Any element of any Brighter Planet
|
40
|
+
* Any element of any Brighter Planet CM1 web service,
|
41
41
|
including but not limited to the copyrights, trademarks, graphic
|
42
42
|
design, text, documentation, method of interaction with clients,
|
43
43
|
runtime environment, technical infrastructure, and software code, is
|
44
44
|
not covered by the license; and
|
45
45
|
|
46
|
-
* Any aspect or use of http://carbon.brighterplanet.com
|
46
|
+
* Any aspect or use of http://carbon.brighterplanet.com or any other
|
47
|
+
subdomain of brighterplanet.com.
|
47
48
|
|
48
49
|
If you have any questions, please contact licensing@brighterplanet.com
|
49
50
|
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= emitter
|
2
2
|
|
3
|
-
|
3
|
+
Software framework for Brighter Planet's impact modeling libraries. See http://carbon.brighterplanet.com
|
4
4
|
|
5
5
|
== Note on Patches/Pull Requests
|
6
6
|
|
@@ -14,4 +14,4 @@ Base gem for Brighter Planet's carbon model gems. See http://carbon.brighterplan
|
|
14
14
|
|
15
15
|
== Copyright
|
16
16
|
|
17
|
-
Copyright
|
17
|
+
Copyright 2010, 2011 Brighter Planet, Inc. See LICENSE and LICENSE-PREAMBLE for details.
|
data/emitter.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.authors = ["Andy Rossmeissl", "Seamus Abshere", "Ian Hough", "Matt Kling", 'Derek Kastner']
|
10
10
|
s.email = %q{derek@brighterplanet.com}
|
11
11
|
s.homepage = "https://github.com/brighterplanet/emitter"
|
12
|
-
s.summary = %q{
|
13
|
-
s.description = %q{A
|
12
|
+
s.summary = %q{A framework for modelling the impact of real-world entities.}
|
13
|
+
s.description = %q{A framework for modelling the impact of real-world entities.}
|
14
14
|
|
15
15
|
s.files = `git ls-files`.split("\n")
|
16
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -23,12 +23,12 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_dependency 'data_miner', '>=1.2.1' unless ENV['LOCAL_DATA_MINER']
|
24
24
|
s.add_dependency 'earth', '>=0.5.1' unless ENV['LOCAL_EARTH']
|
25
25
|
s.add_dependency 'falls_back_on'
|
26
|
-
s.add_dependency 'leap'
|
26
|
+
s.add_dependency 'leap', '>=0.5.4'
|
27
27
|
s.add_dependency 'summary_judgement'
|
28
28
|
s.add_dependency 'timeframe'
|
29
29
|
s.add_dependency 'weighted_average'
|
30
|
-
s.add_dependency '
|
31
|
-
s.add_development_dependency 'activerecord', '~>3
|
30
|
+
s.add_dependency 'mini_record-compat'
|
31
|
+
s.add_development_dependency 'activerecord', '~>3'
|
32
32
|
s.add_development_dependency 'bueller'
|
33
|
-
s.add_development_dependency 'sniff', '
|
33
|
+
s.add_development_dependency 'sniff', '~>0.11.0' unless ENV['LOCAL_SNIFF']
|
34
34
|
end
|
data/lib/emitter.rb
CHANGED
@@ -6,14 +6,14 @@ require 'charisma'
|
|
6
6
|
require 'data_miner'
|
7
7
|
require 'summary_judgement'
|
8
8
|
require 'falls_back_on'
|
9
|
-
require '
|
9
|
+
require 'mini_record'
|
10
10
|
|
11
11
|
require 'emitter/measurement'
|
12
12
|
|
13
13
|
module BrighterPlanet
|
14
14
|
module Emitter
|
15
15
|
REQUIRED_COMPONENTS = %w{
|
16
|
-
|
16
|
+
impact_model
|
17
17
|
characterization
|
18
18
|
data
|
19
19
|
relationships
|
@@ -37,17 +37,17 @@ module BrighterPlanet
|
|
37
37
|
require "#{common_name}/#{component}"
|
38
38
|
end
|
39
39
|
|
40
|
-
base.instance_variable_set :@
|
40
|
+
base.instance_variable_set :@impact_scope, @impact_scope if @impact_scope
|
41
41
|
|
42
42
|
base.extend ::Leap::Subject
|
43
|
-
base.send :include, "::BrighterPlanet::#{common_camel}::
|
43
|
+
base.send :include, "::BrighterPlanet::#{common_camel}::ImpactModel".constantize
|
44
44
|
|
45
45
|
base.send :include, ::Charisma
|
46
46
|
base.send :include, "::BrighterPlanet::#{common_camel}::Characterization".constantize
|
47
47
|
base.class_eval do
|
48
48
|
preexisting = characterization.keys
|
49
|
-
decisions[:
|
50
|
-
|
49
|
+
decisions[:impact].committees.reject do |committee|
|
50
|
+
preexisting.include?(committee.name)
|
51
51
|
end.each do |committee|
|
52
52
|
characterize do
|
53
53
|
has committee.name, :options => committee.options.slice(:measures, :display_with)
|
@@ -56,8 +56,8 @@ module BrighterPlanet
|
|
56
56
|
end
|
57
57
|
|
58
58
|
base.send :include, "::BrighterPlanet::#{common_camel}::Data".constantize
|
59
|
-
unless base.data_miner_config.steps.any? { |step| step.description == :
|
60
|
-
base.data_miner_config.steps.unshift ::DataMiner::Process.new(base.data_miner_config, :
|
59
|
+
unless base.data_miner_config.steps.any? { |step| step.description == :auto_upgrade! }
|
60
|
+
base.data_miner_config.steps.unshift ::DataMiner::Process.new(base.data_miner_config, :auto_upgrade! )
|
61
61
|
end
|
62
62
|
unless base.data_miner_config.steps.any? { |step| step.description == :run_data_miner_on_parent_associations! }
|
63
63
|
base.data_miner_config.steps.push ::DataMiner::Process.new(base.data_miner_config, :run_data_miner_on_parent_associations!)
|
@@ -78,13 +78,13 @@ module BrighterPlanet
|
|
78
78
|
|
79
79
|
# this gets added as a class method to the emitter module
|
80
80
|
def scope(statement)
|
81
|
-
@
|
81
|
+
@impact_scope = statement
|
82
82
|
end
|
83
83
|
|
84
84
|
module ClassMethods
|
85
85
|
# this will have been set by self.included on the emitter module
|
86
|
-
def
|
87
|
-
@
|
86
|
+
def impact_scope
|
87
|
+
@impact_scope
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
data/lib/emitter/version.rb
CHANGED
data/spec/emitter_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe BrighterPlanet::Emitter do
|
|
10
10
|
$:.unshift File.expand_path('fixtures/dirigible/lib', File.dirname(__FILE__))
|
11
11
|
require 'dirigible'
|
12
12
|
Airship.send :include, BrighterPlanet::Dirigible
|
13
|
-
Airship.
|
13
|
+
Airship.auto_upgrade!
|
14
14
|
|
15
15
|
$:.unshift File.expand_path('fixtures/biplane/lib', File.dirname(__FILE__))
|
16
16
|
end
|
@@ -33,11 +33,11 @@ describe BrighterPlanet::Emitter do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'should state its own scope' do
|
36
|
-
Airship.
|
36
|
+
Airship.impact_scope.should == 'Anthropogenic impacts resulting from the inflation, launching, and acceleration of dirigibles'
|
37
37
|
end
|
38
38
|
|
39
39
|
it 'should have extra data_miner steps' do
|
40
|
-
Airship.data_miner_config.steps[0].description.should == :
|
40
|
+
Airship.data_miner_config.steps[0].description.should == :auto_upgrade!
|
41
41
|
Airship.data_miner_config.steps[1].description.should == "the first step defined in the emitter module"
|
42
42
|
Airship.data_miner_config.steps[2].description.should == :run_data_miner_on_parent_associations!
|
43
43
|
end
|
@@ -2,11 +2,9 @@ module BrighterPlanet
|
|
2
2
|
module Biplane
|
3
3
|
module Data
|
4
4
|
def self.included(base)
|
5
|
-
base.
|
6
|
-
|
7
|
-
|
8
|
-
integer :dirigible_class_id
|
9
|
-
end
|
5
|
+
base.col :distance, :type => :float
|
6
|
+
base.col :payload, :type => :float
|
7
|
+
base.col :dirigible_class_id, :type => :integer
|
10
8
|
end
|
11
9
|
end
|
12
10
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module BrighterPlanet
|
2
2
|
module Biplane
|
3
|
-
module
|
3
|
+
module ImpactModel
|
4
4
|
def self.included(base)
|
5
|
-
base.decide :
|
6
|
-
committee :
|
5
|
+
base.decide :impact, :with => :characteristics do
|
6
|
+
committee :carbon do # returns kg CO2e
|
7
7
|
quorum 'default' do
|
8
8
|
100.0
|
9
9
|
end
|
@@ -3,6 +3,6 @@ require 'emitter'
|
|
3
3
|
module BrighterPlanet
|
4
4
|
module Dirigible
|
5
5
|
extend BrighterPlanet::Emitter
|
6
|
-
scope 'Anthropogenic
|
6
|
+
scope 'Anthropogenic impacts resulting from the inflation, launching, and acceleration of dirigibles'
|
7
7
|
end
|
8
8
|
end
|
@@ -2,12 +2,10 @@ module BrighterPlanet
|
|
2
2
|
module Dirigible
|
3
3
|
module Data
|
4
4
|
def self.included(base)
|
5
|
-
base.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
integer :dirigible_class_id
|
10
|
-
end
|
5
|
+
base.col :distance, :type => :float
|
6
|
+
base.col :payload, :type => :float
|
7
|
+
base.col :surface_area, :type => :float
|
8
|
+
base.col :dirigible_class_id, :type => :integer
|
11
9
|
|
12
10
|
base.data_miner do
|
13
11
|
process "the first step defined in the emitter module" do
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module BrighterPlanet
|
2
2
|
module Dirigible
|
3
|
-
module
|
3
|
+
module ImpactModel
|
4
4
|
def self.included(base)
|
5
|
-
base.decide :
|
6
|
-
committee :
|
5
|
+
base.decide :impact, :with => :characteristics do
|
6
|
+
committee :carbon do # returns kg CO2e
|
7
7
|
quorum 'default' do
|
8
8
|
100.0
|
9
9
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: emitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.11.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andy Rossmeissl
|
@@ -91,7 +91,7 @@ dependencies:
|
|
91
91
|
requirements:
|
92
92
|
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
94
|
+
version: 0.5.4
|
95
95
|
type: :runtime
|
96
96
|
version_requirements: *id007
|
97
97
|
- !ruby/object:Gem::Dependency
|
@@ -128,7 +128,7 @@ dependencies:
|
|
128
128
|
type: :runtime
|
129
129
|
version_requirements: *id010
|
130
130
|
- !ruby/object:Gem::Dependency
|
131
|
-
name:
|
131
|
+
name: mini_record-compat
|
132
132
|
prerelease: false
|
133
133
|
requirement: &id011 !ruby/object:Gem::Requirement
|
134
134
|
none: false
|
@@ -146,7 +146,7 @@ dependencies:
|
|
146
146
|
requirements:
|
147
147
|
- - ~>
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version: 3
|
149
|
+
version: "3"
|
150
150
|
type: :development
|
151
151
|
version_requirements: *id012
|
152
152
|
- !ruby/object:Gem::Dependency
|
@@ -166,12 +166,12 @@ dependencies:
|
|
166
166
|
requirement: &id014 !ruby/object:Gem::Requirement
|
167
167
|
none: false
|
168
168
|
requirements:
|
169
|
-
- -
|
169
|
+
- - ~>
|
170
170
|
- !ruby/object:Gem::Version
|
171
|
-
version: 0.
|
171
|
+
version: 0.11.0
|
172
172
|
type: :development
|
173
173
|
version_requirements: *id014
|
174
|
-
description: A
|
174
|
+
description: A framework for modelling the impact of real-world entities.
|
175
175
|
email: derek@brighterplanet.com
|
176
176
|
executables: []
|
177
177
|
|
@@ -192,16 +192,16 @@ files:
|
|
192
192
|
- lib/emitter/version.rb
|
193
193
|
- spec/emitter_spec.rb
|
194
194
|
- spec/fixtures/biplane/lib/biplane.rb
|
195
|
-
- spec/fixtures/biplane/lib/biplane/carbon_model.rb
|
196
195
|
- spec/fixtures/biplane/lib/biplane/characterization.rb
|
197
196
|
- spec/fixtures/biplane/lib/biplane/data.rb
|
197
|
+
- spec/fixtures/biplane/lib/biplane/impact_model.rb
|
198
198
|
- spec/fixtures/biplane/lib/biplane/relationships.rb
|
199
199
|
- spec/fixtures/biplane/lib/biplane/summarization.rb
|
200
200
|
- spec/fixtures/dirigible/lib/dirigible.rb
|
201
|
-
- spec/fixtures/dirigible/lib/dirigible/carbon_model.rb
|
202
201
|
- spec/fixtures/dirigible/lib/dirigible/characterization.rb
|
203
202
|
- spec/fixtures/dirigible/lib/dirigible/data.rb
|
204
203
|
- spec/fixtures/dirigible/lib/dirigible/fallback.rb
|
204
|
+
- spec/fixtures/dirigible/lib/dirigible/impact_model.rb
|
205
205
|
- spec/fixtures/dirigible/lib/dirigible/relationships.rb
|
206
206
|
- spec/fixtures/dirigible/lib/dirigible/summarization.rb
|
207
207
|
- spec/spec_helper.rb
|
@@ -232,20 +232,20 @@ rubyforge_project:
|
|
232
232
|
rubygems_version: 1.6.2
|
233
233
|
signing_key:
|
234
234
|
specification_version: 3
|
235
|
-
summary:
|
235
|
+
summary: A framework for modelling the impact of real-world entities.
|
236
236
|
test_files:
|
237
237
|
- spec/emitter_spec.rb
|
238
238
|
- spec/fixtures/biplane/lib/biplane.rb
|
239
|
-
- spec/fixtures/biplane/lib/biplane/carbon_model.rb
|
240
239
|
- spec/fixtures/biplane/lib/biplane/characterization.rb
|
241
240
|
- spec/fixtures/biplane/lib/biplane/data.rb
|
241
|
+
- spec/fixtures/biplane/lib/biplane/impact_model.rb
|
242
242
|
- spec/fixtures/biplane/lib/biplane/relationships.rb
|
243
243
|
- spec/fixtures/biplane/lib/biplane/summarization.rb
|
244
244
|
- spec/fixtures/dirigible/lib/dirigible.rb
|
245
|
-
- spec/fixtures/dirigible/lib/dirigible/carbon_model.rb
|
246
245
|
- spec/fixtures/dirigible/lib/dirigible/characterization.rb
|
247
246
|
- spec/fixtures/dirigible/lib/dirigible/data.rb
|
248
247
|
- spec/fixtures/dirigible/lib/dirigible/fallback.rb
|
248
|
+
- spec/fixtures/dirigible/lib/dirigible/impact_model.rb
|
249
249
|
- spec/fixtures/dirigible/lib/dirigible/relationships.rb
|
250
250
|
- spec/fixtures/dirigible/lib/dirigible/summarization.rb
|
251
251
|
- spec/spec_helper.rb
|