motorcycle 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/motorcycle.rb +0 -10
- data/lib/motorcycle/fallback.rb +10 -0
- data/lib/motorcycle/relationships.rb +9 -0
- data/lib/test_support/motorcycle_record.rb +0 -3
- metadata +6 -4
data/lib/motorcycle.rb
CHANGED
@@ -3,15 +3,5 @@ require 'emitter'
|
|
3
3
|
module BrighterPlanet
|
4
4
|
module Motorcycle
|
5
5
|
extend BrighterPlanet::Emitter
|
6
|
-
|
7
|
-
def self.motorcycle_model
|
8
|
-
if Object.const_defined? 'Motorcycle'
|
9
|
-
::Motorcycle
|
10
|
-
elsif Object.const_defined? 'MotorcycleRecord'
|
11
|
-
MotorcycleRecord
|
12
|
-
else
|
13
|
-
raise 'There is no motorcycle model'
|
14
|
-
end
|
15
|
-
end
|
16
6
|
end
|
17
7
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module BrighterPlanet
|
2
|
+
module Motorcycle
|
3
|
+
module Fallback
|
4
|
+
def self.included(base)
|
5
|
+
base.falls_back_on :fuel_efficiency => 61.1.miles_per_gallon.to(:kilometres_per_litre), # https://brighterplanet.sifterapp.com/projects/30/issues/818/comments
|
6
|
+
:annual_distance_estimate => 1613.miles.to(:kilometres) # https://brighterplanet.sifterapp.com/projects/30/issues/818/comments
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -3,7 +3,4 @@ require 'motorcycle'
|
|
3
3
|
class MotorcycleRecord < ActiveRecord::Base
|
4
4
|
include Sniff::Emitter
|
5
5
|
include BrighterPlanet::Motorcycle
|
6
|
-
|
7
|
-
falls_back_on :fuel_efficiency => 61.1.miles_per_gallon.to(:kilometres_per_litre), # https://brighterplanet.sifterapp.com/projects/30/issues/818/comments
|
8
|
-
:annual_distance_estimate => 1613.miles.to(:kilometres) # https://brighterplanet.sifterapp.com/projects/30/issues/818/comments
|
9
6
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motorcycle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 13
|
10
|
+
version: 0.0.13
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andy Rossmeissl
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2010-12-
|
22
|
+
date: 2010-12-07 00:00:00 -06:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
@@ -171,6 +171,8 @@ files:
|
|
171
171
|
- lib/motorcycle/carbon_model.rb
|
172
172
|
- lib/motorcycle/characterization.rb
|
173
173
|
- lib/motorcycle/data.rb
|
174
|
+
- lib/motorcycle/fallback.rb
|
175
|
+
- lib/motorcycle/relationships.rb
|
174
176
|
- lib/motorcycle/summarization.rb
|
175
177
|
- lib/test_support/motorcycle_record.rb
|
176
178
|
- features/support/env.rb
|