earth 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/earth.gemspec CHANGED
@@ -4,7 +4,7 @@ require "earth/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "earth"
7
- s.version = "0.4.3"
7
+ s.version = "0.4.4"
8
8
  s.date = "2011-02-25"
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.authors = ["Seamus Abshere", "Derek Kastner", "Andy Rossmeissl"]
data/lib/earth.rb CHANGED
@@ -121,27 +121,8 @@ private
121
121
  end
122
122
 
123
123
  def load_schemas(options = {})
124
- force_fallback_table
125
124
  load_data_miner_schemas(options)
126
125
  end
127
-
128
- # sabshere 9/17/10 this sucks. the falls_back_on gem sucks.
129
- def force_fallback_table
130
- c = ActiveRecord::Base.connection
131
- if c.table_exists? 'fallbacks'
132
- raise "The earth gem expects a different schema for the fallbacks table." unless c.column_exists?('fallbacks', 'name') and
133
- c.column_exists?('fallbacks', 'values') and
134
- c.column_exists?('fallbacks', 'created_at') and
135
- c.column_exists?('fallbacks', 'updated_at')
136
- else
137
- c.create_table 'fallbacks' do |t|
138
- t.string 'name'
139
- t.text 'values'
140
- t.datetime 'created_at'
141
- t.datetime 'updated_at'
142
- end
143
- end
144
- end
145
126
 
146
127
  def load_data_miner_schemas(options = {})
147
128
  models = Module.constants.select do |k|
@@ -31,15 +31,6 @@ class AutomobileFuel < ActiveRecord::Base
31
31
  diesel_use / (gas_use + diesel_use)
32
32
  end
33
33
 
34
- def fallback_annual_distance
35
- (AutomobileFuel.find_by_code("R").annual_distance * (1 - AutomobileFuel.fallback_blend_portion)) +
36
- (AutomobileFuel.find_by_code("D").annual_distance * AutomobileFuel.fallback_blend_portion)
37
- end
38
-
39
- def fallback_annual_distance_units
40
- AutomobileFuel.find_by_code("R").annual_distance_units
41
- end
42
-
43
34
  def fallback_co2_emission_factor
44
35
  (Fuel.find_by_name("Motor Gasoline").co2_emission_factor * (1 - AutomobileFuel.fallback_blend_portion)) +
45
36
  (Fuel.find_by_name("Distillate Fuel Oil No. 2").co2_emission_factor * AutomobileFuel.fallback_blend_portion)
data/spec/earth_spec.rb CHANGED
@@ -18,10 +18,6 @@ describe Earth do
18
18
  end
19
19
  require 'earth/data_miner'
20
20
  end
21
-
22
- it 'should create a fallbacks table' do
23
- Fallback.should be_table_exists
24
- end
25
21
  end
26
22
 
27
23
  describe '.resources' do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: earth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 3
10
- version: 0.4.3
9
+ - 4
10
+ version: 0.4.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Seamus Abshere