emitter 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
data/lib/emitter.rb CHANGED
@@ -1,8 +1,11 @@
1
1
  module BrighterPlanet
2
2
  module Emitter
3
+ BETA_EMITTERS = %{}
4
+
3
5
  REQUIRED_COMPONENTS = %w{carbon_model characterization data summarization}
4
6
  OPTIONAL_COMPONENTS = %w{fallback relationships}
5
7
  def included(base)
8
+ base.extend Meta
6
9
  base.extend ClassMethods
7
10
 
8
11
  common_name = self.to_s.split('::').last.underscore
@@ -57,5 +60,11 @@ module BrighterPlanet
57
60
  end
58
61
  end
59
62
  end
63
+
64
+ module Meta
65
+ def beta?
66
+ BETA_EMITTERS.include?(self.to_s.underscore)
67
+ end
68
+ end
60
69
  end
61
70
  end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ class Automobile; extend BrighterPlanet::Emitter::Meta; end
4
+ class Flight; extend BrighterPlanet::Emitter::Meta; end
5
+
6
+ describe BrighterPlanet::Emitter::Meta do
7
+ describe '.beta?' do
8
+ it 'should return true for an emitter that is in beta' do
9
+ BrighterPlanet::Emitter::BETA_EMITTERS = 'flight'
10
+ Flight.should be_beta
11
+ end
12
+ it 'should return false for an emitter that is not in beta' do
13
+ Automobile.should_not be_beta
14
+ end
15
+ end
16
+ end
17
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 9
9
- version: 0.1.9
8
+ - 10
9
+ version: 0.1.10
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andy Rossmeissl
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2010-11-03 00:00:00 -04:00
21
+ date: 2010-11-08 00:00:00 -05:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
@@ -317,6 +317,7 @@ files:
317
317
  - README.rdoc
318
318
  - lib/emitter.rb
319
319
  - lib/emitter/tasks.rb
320
+ - spec/emitter/meta_spec.rb
320
321
  - spec/emitter_spec.rb
321
322
  - spec/fixtures/dirigible/lib/dirigible/fallback.rb
322
323
  - spec/fixtures/dirigible/lib/dirigible/carbon_model.rb
@@ -345,7 +346,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
345
346
  requirements:
346
347
  - - ">="
347
348
  - !ruby/object:Gem::Version
348
- hash: -338592077
349
+ hash: -507241873
349
350
  segments:
350
351
  - 0
351
352
  version: "0"
@@ -365,6 +366,7 @@ signing_key:
365
366
  specification_version: 3
366
367
  summary: The mother of all carbon models
367
368
  test_files:
369
+ - spec/emitter/meta_spec.rb
368
370
  - spec/emitter_spec.rb
369
371
  - spec/fixtures/dirigible/lib/dirigible/fallback.rb
370
372
  - spec/fixtures/dirigible/lib/dirigible/carbon_model.rb