emitter 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/emitter.gemspec CHANGED
@@ -1,9 +1,10 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
+ require "emitter/version"
3
4
 
4
5
  Gem::Specification.new do |s|
5
6
  s.name = 'emitter'
6
- s.version = "0.4.0"
7
+ s.version = Emitter::VERSION
7
8
  s.platform = Gem::Platform::RUBY
8
9
  s.authors = ["Andy Rossmeissl", "Seamus Abshere", "Ian Hough", "Matt Kling", 'Derek Kastner']
9
10
  s.email = %q{derek@brighterplanet.com}
@@ -16,16 +17,17 @@ Gem::Specification.new do |s|
16
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
18
  s.require_paths = ["lib"]
18
19
 
19
- s.add_development_dependency 'activerecord'
20
- s.add_development_dependency 'sniff', '~> 0.5.0'
21
- s.add_dependency 'activesupport'
20
+ s.add_dependency 'activesupport', '>=2.3.4'
22
21
  s.add_dependency 'characterizable'
23
22
  s.add_dependency 'cohort_scope'
24
- s.add_dependency 'data_miner'
25
- s.add_dependency 'earth'
26
- s.add_dependency 'falls_back_on'
27
- s.add_dependency 'leap'
23
+ s.add_dependency 'data_miner', '>=1.1' unless ENV['LOCAL_DATA_MINER']
24
+ s.add_dependency 'earth' unless ENV['LOCAL_EARTH']
25
+ s.add_dependency 'falls_back_on' unless ENV['LOCAL_FALLS_BACK_ON']
26
+ s.add_dependency 'leap' unless ENV['LOCAL_LEAP']
28
27
  s.add_dependency 'summary_judgement'
29
28
  s.add_dependency 'timeframe'
30
29
  s.add_dependency 'weighted_average'
30
+ s.add_development_dependency 'activerecord', '~>3'
31
+ s.add_development_dependency 'bueller'
32
+ s.add_development_dependency 'sniff'
31
33
  end
@@ -0,0 +1,3 @@
1
+ module Emitter
2
+ VERSION = '0.4.1'
3
+ end
data/lib/emitter.rb CHANGED
@@ -6,6 +6,7 @@ module BrighterPlanet
6
6
  bus_trip
7
7
  computation
8
8
  diet
9
+ electricity_use
9
10
  flight
10
11
  fuel_purchase
11
12
  lodging
@@ -36,6 +37,8 @@ module BrighterPlanet
36
37
  require "#{common_name}/#{component}"
37
38
  end
38
39
 
40
+ base.instance_variable_set :@emission_scope, @emission_scope if @emission_scope
41
+
39
42
  require 'leap'
40
43
  require 'cohort_scope'
41
44
  base.extend ::Leap::Subject
@@ -59,17 +62,23 @@ module BrighterPlanet
59
62
 
60
63
  base.send :include, "::BrighterPlanet::#{common_camel}::Relationships".constantize
61
64
  end
62
-
65
+
63
66
  def self.classes
64
67
  LIST.map(&:camelize).map(&:constantize)
65
68
  end
66
69
 
70
+ def scope(statement)
71
+ @emission_scope = statement
72
+ end
73
+
67
74
  module ClassMethods
68
75
  def add_implicit_characteristics
69
76
  decisions[:emission].committees.map(&:name).reject { |c| characteristics.keys.unshift(:emission).include? c }.each do |c|
70
77
  characterize { has c }
71
78
  end
72
79
  end
80
+
81
+ def emission_scope; @emission_scope end
73
82
  end
74
83
 
75
84
  module Meta
data/spec/emitter_spec.rb CHANGED
@@ -31,6 +31,10 @@ describe BrighterPlanet::Emitter do
31
31
  Aircraft.send :include, BrighterPlanet::Biplane
32
32
  end.should_not raise_error
33
33
  end
34
+
35
+ it 'should state its own scope' do
36
+ Airship.emission_scope.should == 'Anthropogenic emissions resulting from the inflation, launching, and acceleration of dirigibles'
37
+ end
34
38
  end
35
39
  end
36
40
 
@@ -3,5 +3,6 @@ require 'emitter'
3
3
  module BrighterPlanet
4
4
  module Dirigible
5
5
  extend BrighterPlanet::Emitter
6
+ scope 'Anthropogenic emissions resulting from the inflation, launching, and acceleration of dirigibles'
6
7
  end
7
8
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 0
9
- version: 0.4.0
8
+ - 1
9
+ version: 0.4.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andy Rossmeissl
@@ -18,39 +18,39 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-01-27 00:00:00 -05:00
21
+ date: 2011-02-14 00:00:00 -05:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
25
- name: activerecord
25
+ name: activesupport
26
26
  requirement: &id001 !ruby/object:Gem::Requirement
27
27
  none: false
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
31
  segments:
32
- - 0
33
- version: "0"
34
- type: :development
32
+ - 2
33
+ - 3
34
+ - 4
35
+ version: 2.3.4
36
+ type: :runtime
35
37
  prerelease: false
36
38
  version_requirements: *id001
37
39
  - !ruby/object:Gem::Dependency
38
- name: sniff
40
+ name: characterizable
39
41
  requirement: &id002 !ruby/object:Gem::Requirement
40
42
  none: false
41
43
  requirements:
42
- - - ~>
44
+ - - ">="
43
45
  - !ruby/object:Gem::Version
44
46
  segments:
45
47
  - 0
46
- - 5
47
- - 0
48
- version: 0.5.0
49
- type: :development
48
+ version: "0"
49
+ type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: *id002
52
52
  - !ruby/object:Gem::Dependency
53
- name: activesupport
53
+ name: cohort_scope
54
54
  requirement: &id003 !ruby/object:Gem::Requirement
55
55
  none: false
56
56
  requirements:
@@ -63,20 +63,21 @@ dependencies:
63
63
  prerelease: false
64
64
  version_requirements: *id003
65
65
  - !ruby/object:Gem::Dependency
66
- name: characterizable
66
+ name: data_miner
67
67
  requirement: &id004 !ruby/object:Gem::Requirement
68
68
  none: false
69
69
  requirements:
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  segments:
73
- - 0
74
- version: "0"
73
+ - 1
74
+ - 1
75
+ version: "1.1"
75
76
  type: :runtime
76
77
  prerelease: false
77
78
  version_requirements: *id004
78
79
  - !ruby/object:Gem::Dependency
79
- name: cohort_scope
80
+ name: earth
80
81
  requirement: &id005 !ruby/object:Gem::Requirement
81
82
  none: false
82
83
  requirements:
@@ -89,7 +90,7 @@ dependencies:
89
90
  prerelease: false
90
91
  version_requirements: *id005
91
92
  - !ruby/object:Gem::Dependency
92
- name: data_miner
93
+ name: falls_back_on
93
94
  requirement: &id006 !ruby/object:Gem::Requirement
94
95
  none: false
95
96
  requirements:
@@ -102,7 +103,7 @@ dependencies:
102
103
  prerelease: false
103
104
  version_requirements: *id006
104
105
  - !ruby/object:Gem::Dependency
105
- name: earth
106
+ name: leap
106
107
  requirement: &id007 !ruby/object:Gem::Requirement
107
108
  none: false
108
109
  requirements:
@@ -115,7 +116,7 @@ dependencies:
115
116
  prerelease: false
116
117
  version_requirements: *id007
117
118
  - !ruby/object:Gem::Dependency
118
- name: falls_back_on
119
+ name: summary_judgement
119
120
  requirement: &id008 !ruby/object:Gem::Requirement
120
121
  none: false
121
122
  requirements:
@@ -128,7 +129,7 @@ dependencies:
128
129
  prerelease: false
129
130
  version_requirements: *id008
130
131
  - !ruby/object:Gem::Dependency
131
- name: leap
132
+ name: timeframe
132
133
  requirement: &id009 !ruby/object:Gem::Requirement
133
134
  none: false
134
135
  requirements:
@@ -141,7 +142,7 @@ dependencies:
141
142
  prerelease: false
142
143
  version_requirements: *id009
143
144
  - !ruby/object:Gem::Dependency
144
- name: summary_judgement
145
+ name: weighted_average
145
146
  requirement: &id010 !ruby/object:Gem::Requirement
146
147
  none: false
147
148
  requirements:
@@ -154,20 +155,20 @@ dependencies:
154
155
  prerelease: false
155
156
  version_requirements: *id010
156
157
  - !ruby/object:Gem::Dependency
157
- name: timeframe
158
+ name: activerecord
158
159
  requirement: &id011 !ruby/object:Gem::Requirement
159
160
  none: false
160
161
  requirements:
161
- - - ">="
162
+ - - ~>
162
163
  - !ruby/object:Gem::Version
163
164
  segments:
164
- - 0
165
- version: "0"
166
- type: :runtime
165
+ - 3
166
+ version: "3"
167
+ type: :development
167
168
  prerelease: false
168
169
  version_requirements: *id011
169
170
  - !ruby/object:Gem::Dependency
170
- name: weighted_average
171
+ name: bueller
171
172
  requirement: &id012 !ruby/object:Gem::Requirement
172
173
  none: false
173
174
  requirements:
@@ -176,9 +177,22 @@ dependencies:
176
177
  segments:
177
178
  - 0
178
179
  version: "0"
179
- type: :runtime
180
+ type: :development
180
181
  prerelease: false
181
182
  version_requirements: *id012
183
+ - !ruby/object:Gem::Dependency
184
+ name: sniff
185
+ requirement: &id013 !ruby/object:Gem::Requirement
186
+ none: false
187
+ requirements:
188
+ - - ">="
189
+ - !ruby/object:Gem::Version
190
+ segments:
191
+ - 0
192
+ version: "0"
193
+ type: :development
194
+ prerelease: false
195
+ version_requirements: *id013
182
196
  description: A software model in Ruby for the greenhouse gas emissions
183
197
  email: derek@brighterplanet.com
184
198
  executables: []
@@ -196,6 +210,7 @@ files:
196
210
  - Rakefile
197
211
  - emitter.gemspec
198
212
  - lib/emitter.rb
213
+ - lib/emitter/version.rb
199
214
  - spec/emitter/meta_spec.rb
200
215
  - spec/emitter_spec.rb
201
216
  - spec/fixtures/biplane/lib/biplane.rb
@@ -227,7 +242,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
227
242
  requirements:
228
243
  - - ">="
229
244
  - !ruby/object:Gem::Version
230
- hash: 944534127
245
+ hash: 125476555952347040
231
246
  segments:
232
247
  - 0
233
248
  version: "0"
@@ -236,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
251
  requirements:
237
252
  - - ">="
238
253
  - !ruby/object:Gem::Version
239
- hash: 944534127
254
+ hash: 125476555952347040
240
255
  segments:
241
256
  - 0
242
257
  version: "0"
@@ -247,5 +262,21 @@ rubygems_version: 1.3.7
247
262
  signing_key:
248
263
  specification_version: 3
249
264
  summary: The mother of all carbon models
250
- test_files: []
251
-
265
+ test_files:
266
+ - spec/emitter/meta_spec.rb
267
+ - spec/emitter_spec.rb
268
+ - spec/fixtures/biplane/lib/biplane.rb
269
+ - spec/fixtures/biplane/lib/biplane/carbon_model.rb
270
+ - spec/fixtures/biplane/lib/biplane/characterization.rb
271
+ - spec/fixtures/biplane/lib/biplane/data.rb
272
+ - spec/fixtures/biplane/lib/biplane/fallback.rb
273
+ - spec/fixtures/biplane/lib/biplane/relationships.rb
274
+ - spec/fixtures/biplane/lib/biplane/summarization.rb
275
+ - spec/fixtures/dirigible/lib/dirigible.rb
276
+ - spec/fixtures/dirigible/lib/dirigible/carbon_model.rb
277
+ - spec/fixtures/dirigible/lib/dirigible/characterization.rb
278
+ - spec/fixtures/dirigible/lib/dirigible/data.rb
279
+ - spec/fixtures/dirigible/lib/dirigible/fallback.rb
280
+ - spec/fixtures/dirigible/lib/dirigible/relationships.rb
281
+ - spec/fixtures/dirigible/lib/dirigible/summarization.rb
282
+ - spec/spec_helper.rb