emitter 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/emitter.rb +7 -2
- data/spec/emitter/meta_spec.rb +1 -1
- metadata +3 -3
data/lib/emitter.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module BrighterPlanet
|
2
2
|
module Emitter
|
3
|
-
|
3
|
+
LIST = %w{automobile automobile_trip bus_trip computation diet flight fuel_purchase lodging meeting motorcycle pet purchase rail_trip residence}
|
4
|
+
BETA_LIST = %w{}
|
4
5
|
|
5
6
|
REQUIRED_COMPONENTS = %w{carbon_model characterization data summarization}
|
6
7
|
OPTIONAL_COMPONENTS = %w{fallback relationships}
|
@@ -52,6 +53,10 @@ module BrighterPlanet
|
|
52
53
|
base.send :include, "::BrighterPlanet::#{common_camel}::Relationships".constantize
|
53
54
|
end
|
54
55
|
end
|
56
|
+
|
57
|
+
def self.classes
|
58
|
+
LIST.map(&:camelize).map(&:constantize)
|
59
|
+
end
|
55
60
|
|
56
61
|
module ClassMethods
|
57
62
|
def add_implicit_characteristics
|
@@ -63,7 +68,7 @@ module BrighterPlanet
|
|
63
68
|
|
64
69
|
module Meta
|
65
70
|
def beta?
|
66
|
-
|
71
|
+
BETA_LIST.include?(self.to_s.underscore)
|
67
72
|
end
|
68
73
|
end
|
69
74
|
end
|
data/spec/emitter/meta_spec.rb
CHANGED
@@ -6,7 +6,7 @@ class Flight; extend BrighterPlanet::Emitter::Meta; end
|
|
6
6
|
describe BrighterPlanet::Emitter::Meta do
|
7
7
|
describe '.beta?' do
|
8
8
|
it 'should return true for an emitter that is in beta' do
|
9
|
-
BrighterPlanet::Emitter::
|
9
|
+
BrighterPlanet::Emitter::BETA_LIST = ['flight']
|
10
10
|
Flight.should be_beta
|
11
11
|
end
|
12
12
|
it 'should return false for an emitter that is not in beta' do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 11
|
9
|
+
version: 0.1.11
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Andy Rossmeissl
|
@@ -346,7 +346,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
346
346
|
requirements:
|
347
347
|
- - ">="
|
348
348
|
- !ruby/object:Gem::Version
|
349
|
-
hash:
|
349
|
+
hash: 309415069
|
350
350
|
segments:
|
351
351
|
- 0
|
352
352
|
version: "0"
|