earth 0.3.15 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/Gemfile +1 -0
  2. data/earth.gemspec +4 -4
  3. data/features/automobile_fuel.feature +44 -0
  4. data/features/automobile_type_fuel_age.feature +2 -1
  5. data/features/automobile_type_fuel_year.feature +86 -16
  6. data/features/automobile_type_fuel_year_age.feature +94 -0
  7. data/features/automobile_type_fuel_year_control.feature +44 -4
  8. data/features/automobile_type_year.feature +27 -7
  9. data/features/carrier_mode.feature +20 -30
  10. data/features/fuel_year.feature +22 -12
  11. data/features/support/imports/automobile_fuel_bad.csv +3 -0
  12. data/features/support/imports/automobile_fuel_good.csv +3 -0
  13. data/features/support/imports/automobile_type_fuel_year_age_bad.csv +2 -0
  14. data/features/support/imports/automobile_type_fuel_year_age_good.csv +2 -0
  15. data/features/support/imports/automobile_type_fuel_year_bad.csv +2 -2
  16. data/features/support/imports/automobile_type_fuel_year_control_bad.csv +2 -3
  17. data/features/support/imports/automobile_type_fuel_year_control_good.csv +2 -3
  18. data/features/support/imports/automobile_type_fuel_year_good.csv +2 -2
  19. data/features/support/imports/automobile_type_year_bad.csv +2 -2
  20. data/features/support/imports/automobile_type_year_good.csv +2 -2
  21. data/features/support/imports/carrier_mode_bad.csv +2 -3
  22. data/features/support/imports/carrier_mode_good.csv +2 -3
  23. data/features/support/imports/fuel_year_bad.csv +2 -2
  24. data/features/support/imports/fuel_year_good.csv +2 -2
  25. data/lib/earth.rb +5 -5
  26. data/lib/earth/air/airline/data_miner.rb +1 -0
  27. data/lib/earth/air/airport/data_miner.rb +1 -1
  28. data/lib/earth/air/flight_segment/data_miner.rb +5 -0
  29. data/lib/earth/automobile.rb +2 -0
  30. data/lib/earth/automobile/automobile_fuel.rb +93 -0
  31. data/lib/earth/automobile/automobile_fuel/data_miner.rb +60 -0
  32. data/lib/earth/automobile/automobile_fuel_type.rb +1 -0
  33. data/lib/earth/automobile/automobile_fuel_type/data_miner.rb +2 -1
  34. data/lib/earth/automobile/automobile_make/data_miner.rb +11 -0
  35. data/lib/earth/automobile/automobile_make_fleet_year.rb +2 -2
  36. data/lib/earth/automobile/automobile_make_model.rb +1 -1
  37. data/lib/earth/automobile/automobile_make_model/data_miner.rb +1 -0
  38. data/lib/earth/automobile/automobile_make_model_year/data_miner.rb +1 -0
  39. data/lib/earth/automobile/automobile_make_model_year_variant.rb +2 -1
  40. data/lib/earth/automobile/automobile_make_model_year_variant/data_miner.rb +21 -7
  41. data/lib/earth/automobile/automobile_make_year.rb +2 -2
  42. data/lib/earth/automobile/automobile_make_year/data_miner.rb +3 -0
  43. data/lib/earth/automobile/automobile_size_class/data_miner.rb +11 -7
  44. data/lib/earth/automobile/automobile_size_class_year/data_miner.rb +2 -1
  45. data/lib/earth/automobile/automobile_type_fuel_age.rb +1 -0
  46. data/lib/earth/automobile/automobile_type_fuel_age/data_miner.rb +52 -34
  47. data/lib/earth/automobile/automobile_type_fuel_control/data_miner.rb +1 -1
  48. data/lib/earth/automobile/automobile_type_fuel_year.rb +7 -0
  49. data/lib/earth/automobile/automobile_type_fuel_year/data_miner.rb +57 -63
  50. data/lib/earth/automobile/automobile_type_fuel_year_age.rb +13 -0
  51. data/lib/earth/automobile/automobile_type_fuel_year_age/data_miner.rb +184 -0
  52. data/lib/earth/automobile/automobile_type_fuel_year_control.rb +6 -0
  53. data/lib/earth/automobile/automobile_type_fuel_year_control/data_miner.rb +24 -8
  54. data/lib/earth/automobile/automobile_type_year.rb +2 -0
  55. data/lib/earth/automobile/automobile_type_year/data_miner.rb +28 -11
  56. data/lib/earth/automobile/data_miner.rb +2 -0
  57. data/lib/earth/bus/bus_class.rb +8 -8
  58. data/lib/earth/computation/computation_platform/data_miner.rb +1 -1
  59. data/lib/earth/computation/server_type/data_miner.rb +1 -1
  60. data/lib/earth/computation/server_type_alias/data_miner.rb +1 -1
  61. data/lib/earth/conversions_ext.rb +4 -0
  62. data/lib/earth/fuel.rb +1 -0
  63. data/lib/earth/fuel/data_miner.rb +1 -0
  64. data/lib/earth/fuel/fuel.rb +77 -0
  65. data/lib/earth/fuel/fuel/data_miner.rb +98 -0
  66. data/lib/earth/fuel/fuel_type/data_miner.rb +2 -2
  67. data/lib/earth/fuel/fuel_year/data_miner.rb +95 -26
  68. data/lib/earth/fuel/greenhouse_gas.rb +6 -0
  69. data/lib/earth/fuel/greenhouse_gas/data_miner.rb +1 -1
  70. data/lib/earth/hospitality/lodging_class/data_miner.rb +21 -9
  71. data/lib/earth/locality/census_division.rb +6 -5
  72. data/lib/earth/locality/census_division/data_miner.rb +9 -9
  73. data/lib/earth/locality/country.rb +9 -0
  74. data/lib/earth/locality/country/data_miner.rb +1 -1
  75. data/lib/earth/pet/breed/data_miner.rb +0 -1
  76. data/lib/earth/pet/breed_gender/data_miner.rb +0 -1
  77. data/lib/earth/shipping/carrier.rb +3 -3
  78. data/lib/earth/shipping/carrier/data_miner.rb +2 -2
  79. data/lib/earth/shipping/carrier_mode/data_miner.rb +15 -42
  80. data/lib/earth/shipping/shipment_mode/data_miner.rb +1 -1
  81. data/lib/earth/version.rb +1 -1
  82. data/spec/earth/automobile/automobile_fuel_spec.rb +19 -0
  83. data/spec/earth_spec.rb +3 -3
  84. metadata +141 -33
@@ -4,4 +4,10 @@ class GreenhouseGas < ActiveRecord::Base
4
4
  data_miner do
5
5
  tap "Brighter Planet's greenhouse gas data", Earth.taps_server
6
6
  end
7
+
8
+ class << self
9
+ def [](abbreviation)
10
+ find_by_abbreviation abbreviation.to_s
11
+ end
12
+ end
7
13
  end
@@ -22,7 +22,7 @@ GreenhouseGas.class_eval do
22
22
  GreenhouseGas.all.each do |record|
23
23
  %w{ abbreviation ipcc_report }.each do |attribute|
24
24
  value = record.send(:"#{attribute}")
25
- if value.nil?
25
+ unless value.present?
26
26
  raise "Missing #{attribute} for GreenhouseGas '#{record.name}'"
27
27
  end
28
28
  end
@@ -2,19 +2,31 @@ LodgingClass.class_eval do
2
2
  data_miner do
3
3
  LodgingClass.define_schema(self)
4
4
 
5
- process "Define some unit conversions" do
6
- Conversions.register :hundred_cubic_feet_per_room_night, :cubic_metres_per_room_night, 2.831685
7
- Conversions.register :gallons_per_room_night, :litres_per_room_night, 3.785412
8
- Conversions.register :thousand_btu_per_room_night, :joules_per_room_night, 1_055_056
9
- end
10
-
11
5
  import "a list of lodging classes and pre-calculated emission factors",
12
6
  :url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdGZZWmZtWEJlYzhRNXlPdWpBTldlcUE&hl=en&output=csv' do
13
7
  key 'name'
14
- store 'natural_gas_intensity', :from_units => :hundred_cubic_feet_per_room_night, :to_units => :cubic_metres_per_room_night
15
- store 'fuel_oil_intensity', :from_units => :gallons_per_room_night, :to_units => :litres_per_room_night
8
+ store 'natural_gas_intensity', :units_field_name => 'natural_gas_intensity_units'
9
+ store 'fuel_oil_intensity', :units_field_name => 'fuel_oil_intensity_units'
16
10
  store 'electricity_intensity', :units_field_name => 'electricity_intensity_units'
17
- store 'district_heat_intensity', :from_units => :thousand_btu_per_room_night, :to_units => :joules_per_room_night
11
+ store 'district_heat_intensity', :units_field_name => 'district_heat_intensity_units'
12
+ end
13
+
14
+ process "Convert natural gas intensities to metric units" do
15
+ conversion_factor = 2.83168466 # Google: 2.83168466 cubic m / 100 cubic ft
16
+ update_all "natural_gas_intensity = natural_gas_intensity * #{conversion_factor} WHERE natural_gas_intensity_units = 'hundred_cubic_feet_per_room_night'"
17
+ update_all "natural_gas_intensity_units = 'cubic_metres_per_room_night' WHERE natural_gas_intensity_units = 'hundred_cubic_feet_per_room_night'"
18
+ end
19
+
20
+ process "Convert fuel oil intensities to metric units" do
21
+ conversion_factor = 3.78541178 # Google: 3.78541178 l / gal
22
+ update_all "fuel_oil_intensity = fuel_oil_intensity * #{conversion_factor} WHERE natural_gas_intensity_units = 'gallons_per_room_night'"
23
+ update_all "fuel_oil_intensity_units = 'litres_per_room_night' WHERE natural_gas_intensity_units = 'gallons_per_room_night'"
24
+ end
25
+
26
+ process "Convert district heat intensities to metric units" do
27
+ conversion_factor = 1.05505585 # Google: 1.05505585 MJ / 1000 Btu
28
+ update_all "district_heat_intensity = district_heat_intensity * #{conversion_factor} WHERE natural_gas_intensity_units = 'thousand_btu_per_room_night'"
29
+ update_all "district_heat_intensity_units = 'megajoules_per_room_night' WHERE natural_gas_intensity_units = 'thousand_btu_per_room_night'"
18
30
  end
19
31
  end
20
32
  end
@@ -7,14 +7,15 @@ class CensusDivision < ActiveRecord::Base
7
7
  has_many :climate_divisions, :through => :states
8
8
  has_many :residential_energy_consumption_survey_responses, :foreign_key => 'census_division_number'
9
9
 
10
- falls_back_on :meeting_building_natural_gas_intensity => 0.011973,
11
- :meeting_building_fuel_oil_intensity => 0.0037381,
12
- :meeting_building_electricity_intensity => 0.072444,
13
- :meeting_building_district_heat_intensity => 3458.7
10
+ # https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdFJ3U3VaSG1oQW1yclY3M3FsRzRDNFE&hl=en&output=html
11
+ falls_back_on :meeting_building_natural_gas_intensity => 0.0004353615 * 100.cubic_feet.to(:cubic_metres) / 1.square_feet.to(:square_metres),
12
+ :meeting_building_fuel_oil_intensity => 0.0000925593.gallons.to(:litres) / 1.square_feet.to(:square_metres),
13
+ :meeting_building_electricity_intensity => 0.0084323684 / 1.square_feet.to(:square_metres),
14
+ :meeting_building_district_heat_intensity => 0.0004776370.kbtus.to(:megajoules) / 1.square_feet.to(:square_metres)
14
15
 
15
16
  data_miner do
16
17
  tap "Brighter Planet's sanitized census divisions", Earth.taps_server
17
-
18
+
18
19
  process "pull dependencies" do
19
20
  run_data_miner_on_belongs_to_associations
20
21
  end
@@ -22,15 +22,15 @@ CensusDivision.class_eval do
22
22
  float 'lodging_building_district_heat_intensity'
23
23
  string 'lodging_building_district_heat_intensity_units'
24
24
  end
25
-
25
+
26
26
  process 'Define some unit conversions' do
27
27
  Conversions.register :hundred_cubic_feet_per_square_foot_hour, :cubic_metres_per_square_metre_hour, 30.48
28
- Conversions.register :gallons_per_square_foot_hour, :litres_per_square_metre_hour, 40.745833
29
- Conversions.register :kilowatt_hours_per_square_foot_hour, :kilowatt_hours_per_square_metre_hour, 10.76391
30
- Conversions.register :thousand_btu_per_square_foot_hour, :joules_per_square_metre_hour, 11_356_527
31
- Conversions.register :hundred_cubic_feet_per_room_night, :cubic_metres_per_room_night, 2.8317
32
- Conversions.register :gallons_per_room_night, :litres_per_room_night, 3.7854
33
- Conversions.register :thousand_btu_per_room_night, :joules_per_room_night, 1_055_056
28
+ Conversions.register :gallons_per_square_foot_hour, :litres_per_square_metre_hour, 40.7458333
29
+ Conversions.register :kilowatt_hours_per_square_foot_hour, :kilowatt_hours_per_square_metre_hour, 10.7639104
30
+ Conversions.register :thousand_btu_per_square_foot_hour, :megajoules_per_square_metre_hour, 11.3565267
31
+ Conversions.register :hundred_cubic_feet_per_room_night, :cubic_metres_per_room_night, 2.83168466
32
+ Conversions.register :gallons_per_room_night, :litres_per_room_night, 3.78541178
33
+ Conversions.register :thousand_btu_per_room_night, :megajoules_per_room_night, 1.05505585
34
34
  end
35
35
 
36
36
  import 'the U.S. Census Geographic Terms and Definitions',
@@ -49,7 +49,7 @@ CensusDivision.class_eval do
49
49
  store 'meeting_building_natural_gas_intensity', :from_units => :hundred_cubic_feet_per_square_foot_hour, :to_units => :cubic_metres_per_square_metre_hour
50
50
  store 'meeting_building_fuel_oil_intensity', :from_units => :gallons_per_square_foot_hour, :to_units => :litres_per_square_metre_hour
51
51
  store 'meeting_building_electricity_intensity', :from_units => :kilowatt_hours_per_square_foot_hour, :to_units => :kilowatt_hours_per_square_metre_hour
52
- store 'meeting_building_district_heat_intensity', :from_units => :thousand_btu_per_square_foot_hour, :to_units => :joules_per_square_metre_hour
52
+ store 'meeting_building_district_heat_intensity', :from_units => :thousand_btu_per_square_foot_hour, :to_units => :megajoules_per_square_metre_hour
53
53
  end
54
54
 
55
55
  import 'lodging building fuel intensities calculated from CBECS 2003',
@@ -58,7 +58,7 @@ CensusDivision.class_eval do
58
58
  store 'lodging_building_natural_gas_intensity', :from_units => :hundred_cubic_feet_per_room_night, :to_units => :cubic_metres_per_room_night
59
59
  store 'lodging_building_fuel_oil_intensity', :from_units => :gallons_per_room_night, :to_units => :litres_per_room_night
60
60
  store 'lodging_building_electricity_intensity', :units_field_name => 'lodging_building_electricity_intensity_units'
61
- store 'lodging_building_district_heat_intensity', :from_units => :thousand_btu_per_room_night, :to_units => :joules_per_room_night
61
+ store 'lodging_building_district_heat_intensity', :from_units => :thousand_btu_per_room_night, :to_units => :megajoules_per_room_night
62
62
  end
63
63
  end
64
64
  end
@@ -12,4 +12,13 @@ class Country < ActiveRecord::Base
12
12
  find_by_iso_3166_code('US')
13
13
  end
14
14
  end
15
+
16
+ # if we don't have a country-specific flight route inefficiency factor, use the fallback
17
+ def flight_route_inefficiency_factor
18
+ if specific_frif = super
19
+ specific_frif
20
+ else
21
+ Country.fallback.flight_route_inefficiency_factor
22
+ end
23
+ end
15
24
  end
@@ -17,7 +17,7 @@ Country.class_eval do
17
17
  end
18
18
 
19
19
  import "country-specific flight route inefficiency factors derived from Kettunen et al. (2005)",
20
- :url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdG0yc3BxYUkybWV5M3RKb2t4X0JUOFE&hl=en&single=true&gid=0&output=csv' do
20
+ :url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdEJoRVBZaGhnUmlhX240VXE3X0F3WkE&output=csv' do
21
21
  key 'iso_3166_code'
22
22
  store 'flight_route_inefficiency_factor'
23
23
  end
@@ -22,4 +22,3 @@ Breed.class_eval do
22
22
  end
23
23
  end
24
24
  end
25
-
@@ -18,4 +18,3 @@ BreedGender.class_eval do
18
18
  end
19
19
  end
20
20
  end
21
-
@@ -4,9 +4,9 @@ class Carrier < ActiveRecord::Base
4
4
  has_many :carrier_modes, :foreign_key => 'carrier_name', :primary_key => 'name'
5
5
 
6
6
  # TODO calculate these
7
- falls_back_on :route_inefficiency_factor => 1.03,# Carrier.weighted_average(:route_inefficiency_factor, :weighted_by => :package_volume)
8
- :transport_emission_factor => 0.0005266,# Carrier.weighted_average(:transport_emission_factor, :weighted_by => :package_volume)
9
- :corporate_emission_factor => 0.221# Carrier.weighted_average(:corporate_emission_factor, :weighted_by => :package_volume)
7
+ falls_back_on :route_inefficiency_factor => 1.03,
8
+ :transport_emission_factor => 0.0005266,
9
+ :corporate_emission_factor => 0.221
10
10
 
11
11
  data_miner do
12
12
  tap "Brighter Planet's shipping company data", Earth.taps_server
@@ -59,7 +59,7 @@ Carrier.class_eval do
59
59
 
60
60
  verify "Transport emission factor units should never be missing" do
61
61
  Carrier.all.each do |carrier|
62
- if carrier.transport_emission_factor_units.nil?
62
+ unless carrier.transport_emission_factor_units.present?
63
63
  raise "Missing transport emission factor units for Carrier #{carrier.name}"
64
64
  end
65
65
  end
@@ -75,7 +75,7 @@ Carrier.class_eval do
75
75
 
76
76
  verify "Corporate emission factor units should never be missing" do
77
77
  Carrier.all.each do |carrier|
78
- if carrier.corporate_emission_factor_units.nil?
78
+ unless carrier.corporate_emission_factor_units.present?
79
79
  raise "Missing corporate emission factor units for Carrier #{carrier.name}"
80
80
  end
81
81
  end
@@ -4,7 +4,6 @@ CarrierMode.class_eval do
4
4
  string 'name'
5
5
  string 'carrier_name'
6
6
  string 'mode_name'
7
- boolean 'include_in_fallbacks'
8
7
  float 'package_volume'
9
8
  float 'route_inefficiency_factor'
10
9
  float 'transport_emission_factor'
@@ -16,42 +15,32 @@ CarrierMode.class_eval do
16
15
  key 'name'
17
16
  store 'carrier_name'
18
17
  store 'mode_name'
19
- store 'include_in_fallbacks'
20
18
  store 'package_volume'
21
19
  store 'route_inefficiency_factor'
22
20
  store 'transport_emission_factor', :units_field_name => 'transport_emission_factor_units'
23
21
  end
24
22
 
25
23
  # Don't need to check that carrier_name appears in carriers b/c carriers is derived from carrier_modes.carrier_name
26
- verify "Carrier name should never be missing" do
27
- CarrierMode.all.each do |carrier_mode|
28
- if carrier_mode.carrier_name.nil?
29
- raise "Missing carrier name for CarrierMode #{carrier_mode.name}"
30
- end
31
- end
32
- end
33
-
34
24
  # Don't need to check that mode_name appears in shipment_modes b/c shipment_modes is derived from carrier_modes.mode_name
35
- verify "Mode name should never be missing" do
36
- CarrierMode.all.each do |carrier_mode|
37
- if carrier_mode.mode_name.nil?
38
- raise "Missing mode name for CarrierMode #{carrier_mode.name}"
39
- end
40
- end
41
- end
42
-
43
- verify "Include in fallbacks should never be missing" do
44
- CarrierMode.all.each do |carrier_mode|
45
- if carrier_mode.include_in_fallbacks.nil?
46
- raise "Missing include in fallbacks for CarrierMode #{carrier_mode.name}"
25
+ # FIXME TODO test for valid transport_emission_factor_units
26
+ %w{carrier_name mode_name transport_emission_factor_units}.each do |attribute|
27
+ verify "#{attribute.humanize} should never be missing" do
28
+ CarrierMode.all.each do |carrier_mode|
29
+ value = carrier_mode.send(:"#{attribute}")
30
+ unless value.present?
31
+ raise "Missing #{attribute.humanize.downcase} for CarrierMode #{carrier_mode.name}"
32
+ end
47
33
  end
48
34
  end
49
35
  end
50
36
 
51
- verify "Package volume should be greater than zero" do
52
- CarrierMode.all.each do |carrier_mode|
53
- unless carrier_mode.package_volume > 0
54
- raise "Invalid package volume for CarrierMode #{carrier_mode.name}: #{carrier_mode.package_volume} (should be > 0)"
37
+ %w{package_volume transport_emission_factor}.each do |attribute|
38
+ verify "#{attribute.humanize} should be greater than zero" do
39
+ CarrierMode.all.each do |carrier_mode|
40
+ value = carrier_mode.send(:"#{attribute}")
41
+ unless value > 0
42
+ raise "Invalid #{attribute.humanize.downcase} for CarrierMode #{carrier_mode.name}: #{value} (should be > 0)"
43
+ end
55
44
  end
56
45
  end
57
46
  end
@@ -63,21 +52,5 @@ CarrierMode.class_eval do
63
52
  end
64
53
  end
65
54
  end
66
-
67
- verify "Transport emission factor should be greater than zero" do
68
- CarrierMode.all.each do |carrier_mode|
69
- unless carrier_mode.transport_emission_factor > 0
70
- raise "Invalid transport emission factor for CarrierMode #{carrier_mode.name}: #{carrier_mode.transport_emission_factor} (should be > 0)"
71
- end
72
- end
73
- end
74
-
75
- verify "Transport emission factor units should never be missing" do
76
- CarrierMode.all.each do |carrier_mode|
77
- if carrier_mode.transport_emission_factor_units.nil?
78
- raise "Missing transport emission factor units for CarrierMode #{carrier_mode.name}"
79
- end
80
- end
81
- end
82
55
  end
83
56
  end
@@ -44,7 +44,7 @@ ShipmentMode.class_eval do
44
44
 
45
45
  verify "Transport emission factor units should never be missing" do
46
46
  ShipmentMode.all.each do |mode|
47
- if mode.transport_emission_factor_units.nil?
47
+ unless mode.transport_emission_factor_units.present?
48
48
  raise "Missing transport emission factor units for ShipmentMode #{mode.name}"
49
49
  end
50
50
  end
data/lib/earth/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Earth
2
- VERSION = '0.3.14'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+ require 'earth/automobile'
3
+ require 'earth/automobile/data_miner'
4
+
5
+ describe AutomobileFuel do
6
+ before :all do
7
+ AutomobileFuel.run_data_miner!
8
+ end
9
+
10
+ it 'imports data without problems' do
11
+ AutomobileFuel.all.count.should > 0
12
+ end
13
+ # it 'correctly assigns hfc_emission_factor' do
14
+ # AutomobileTypeFuelAge.run_data_miner!
15
+ # AutomobileTypeFuelYear.run_data_miner!
16
+ # AutomobileTypeYear.run_data_miner!
17
+ # AutomobileFuel.first.hfc_emission_factor.should == 0.0
18
+ # end
19
+ end
data/spec/earth_spec.rb CHANGED
@@ -27,7 +27,7 @@ describe Earth do
27
27
  describe '.resources' do
28
28
  it 'should get a list of resources' do
29
29
  resources = Earth.resources
30
- resources.keys.count.should == 71
30
+ resources.keys.count.should == 74
31
31
  resources['FuelType'][:domain].should == 'fuel'
32
32
  end
33
33
  it 'should exclude data_miner files' do
@@ -37,12 +37,12 @@ describe Earth do
37
37
 
38
38
  describe '.resource_names' do
39
39
  it 'should get a list of all resource names' do
40
- Earth.resource_names.count.should == 71
40
+ Earth.resource_names.count.should == 74
41
41
  Earth.resource_names.should include('Aircraft')
42
42
  Earth.resource_names.should include('Industry')
43
43
  end
44
44
  it 'should filter resources by domain' do
45
- Earth.resource_names(['fuel']).count.should == 4
45
+ Earth.resource_names(['fuel']).count.should == 5
46
46
  Earth.resource_names(['fuel']).should include('FuelType')
47
47
  end
48
48
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 3
8
- - 15
9
- version: 0.3.15
7
+ - 4
8
+ - 0
9
+ version: 0.4.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Seamus Abshere
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-01-28 00:00:00 -05:00
19
+ date: 2011-02-17 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -91,7 +91,7 @@ dependencies:
91
91
  prerelease: false
92
92
  version_requirements: *id005
93
93
  - !ruby/object:Gem::Dependency
94
- name: cohort_scope
94
+ name: geokit-rails
95
95
  requirement: &id006 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
@@ -99,44 +99,42 @@ dependencies:
99
99
  - !ruby/object:Gem::Version
100
100
  segments:
101
101
  - 0
102
- - 0
103
- - 7
104
- version: 0.0.7
102
+ version: "0"
105
103
  type: :runtime
106
104
  prerelease: false
107
105
  version_requirements: *id006
108
106
  - !ruby/object:Gem::Dependency
109
- name: conversions
107
+ name: cohort_scope
110
108
  requirement: &id007 !ruby/object:Gem::Requirement
111
109
  none: false
112
110
  requirements:
113
111
  - - ">="
114
112
  - !ruby/object:Gem::Version
115
113
  segments:
116
- - 1
117
- - 4
118
- - 5
119
- version: 1.4.5
114
+ - 0
115
+ - 0
116
+ - 7
117
+ version: 0.0.7
120
118
  type: :runtime
121
119
  prerelease: false
122
120
  version_requirements: *id007
123
121
  - !ruby/object:Gem::Dependency
124
- name: weighted_average
122
+ name: conversions
125
123
  requirement: &id008 !ruby/object:Gem::Requirement
126
124
  none: false
127
125
  requirements:
128
126
  - - ">="
129
127
  - !ruby/object:Gem::Version
130
128
  segments:
131
- - 0
132
- - 0
129
+ - 1
133
130
  - 4
134
- version: 0.0.4
131
+ - 5
132
+ version: 1.4.5
135
133
  type: :runtime
136
134
  prerelease: false
137
135
  version_requirements: *id008
138
136
  - !ruby/object:Gem::Dependency
139
- name: loose_tight_dictionary
137
+ name: weighted_average
140
138
  requirement: &id009 !ruby/object:Gem::Requirement
141
139
  none: false
142
140
  requirements:
@@ -145,36 +143,38 @@ dependencies:
145
143
  segments:
146
144
  - 0
147
145
  - 0
148
- - 8
149
- version: 0.0.8
146
+ - 4
147
+ version: 0.0.4
150
148
  type: :runtime
151
149
  prerelease: false
152
150
  version_requirements: *id009
153
151
  - !ruby/object:Gem::Dependency
154
- name: sniff
152
+ name: loose_tight_dictionary
155
153
  requirement: &id010 !ruby/object:Gem::Requirement
156
154
  none: false
157
155
  requirements:
158
- - - ~>
156
+ - - ">="
159
157
  - !ruby/object:Gem::Version
160
158
  segments:
161
159
  - 0
162
- - 5
163
- - 3
164
- version: 0.5.3
165
- type: :development
160
+ - 0
161
+ - 8
162
+ version: 0.0.8
163
+ type: :runtime
166
164
  prerelease: false
167
165
  version_requirements: *id010
168
166
  - !ruby/object:Gem::Dependency
169
- name: bueller
167
+ name: sniff
170
168
  requirement: &id011 !ruby/object:Gem::Requirement
171
169
  none: false
172
170
  requirements:
173
- - - ">="
171
+ - - ~>
174
172
  - !ruby/object:Gem::Version
175
173
  segments:
176
174
  - 0
177
- version: "0"
175
+ - 6
176
+ - 1
177
+ version: 0.6.1
178
178
  type: :development
179
179
  prerelease: false
180
180
  version_requirements: *id011
@@ -197,6 +197,7 @@ files:
197
197
  - README.markdown
198
198
  - Rakefile
199
199
  - earth.gemspec
200
+ - features/automobile_fuel.feature
200
201
  - features/automobile_fuel_type.feature
201
202
  - features/automobile_make.feature
202
203
  - features/automobile_make_fleet_year.feature
@@ -209,6 +210,7 @@ files:
209
210
  - features/automobile_type_fuel_age.feature
210
211
  - features/automobile_type_fuel_control.feature
211
212
  - features/automobile_type_fuel_year.feature
213
+ - features/automobile_type_fuel_year_age.feature
212
214
  - features/automobile_type_fuel_year_control.feature
213
215
  - features/automobile_type_year.feature
214
216
  - features/bus_class.feature
@@ -226,6 +228,8 @@ files:
226
228
  - features/server_type_alias.feature
227
229
  - features/shipment_mode.feature
228
230
  - features/support/env.rb
231
+ - features/support/imports/automobile_fuel_bad.csv
232
+ - features/support/imports/automobile_fuel_good.csv
229
233
  - features/support/imports/automobile_fuel_type_bad.csv
230
234
  - features/support/imports/automobile_fuel_type_good.csv
231
235
  - features/support/imports/automobile_make_bad.csv
@@ -248,6 +252,8 @@ files:
248
252
  - features/support/imports/automobile_type_fuel_age_good.csv
249
253
  - features/support/imports/automobile_type_fuel_control_bad.csv
250
254
  - features/support/imports/automobile_type_fuel_control_good.csv
255
+ - features/support/imports/automobile_type_fuel_year_age_bad.csv
256
+ - features/support/imports/automobile_type_fuel_year_age_good.csv
251
257
  - features/support/imports/automobile_type_fuel_year_bad.csv
252
258
  - features/support/imports/automobile_type_fuel_year_control_bad.csv
253
259
  - features/support/imports/automobile_type_fuel_year_control_good.csv
@@ -306,6 +312,8 @@ files:
306
312
  - lib/earth/air/flight_segment/data_miner.rb
307
313
  - lib/earth/all.rb
308
314
  - lib/earth/automobile.rb
315
+ - lib/earth/automobile/automobile_fuel.rb
316
+ - lib/earth/automobile/automobile_fuel/data_miner.rb
309
317
  - lib/earth/automobile/automobile_fuel_type.rb
310
318
  - lib/earth/automobile/automobile_fuel_type/data_miner.rb
311
319
  - lib/earth/automobile/automobile_make.rb
@@ -330,6 +338,8 @@ files:
330
338
  - lib/earth/automobile/automobile_type_fuel_control/data_miner.rb
331
339
  - lib/earth/automobile/automobile_type_fuel_year.rb
332
340
  - lib/earth/automobile/automobile_type_fuel_year/data_miner.rb
341
+ - lib/earth/automobile/automobile_type_fuel_year_age.rb
342
+ - lib/earth/automobile/automobile_type_fuel_year_age/data_miner.rb
333
343
  - lib/earth/automobile/automobile_type_fuel_year_control.rb
334
344
  - lib/earth/automobile/automobile_type_fuel_year_control/data_miner.rb
335
345
  - lib/earth/automobile/automobile_type_year.rb
@@ -360,6 +370,8 @@ files:
360
370
  - lib/earth/diet/food_group/data_miner.rb
361
371
  - lib/earth/fuel.rb
362
372
  - lib/earth/fuel/data_miner.rb
373
+ - lib/earth/fuel/fuel.rb
374
+ - lib/earth/fuel/fuel/data_miner.rb
363
375
  - lib/earth/fuel/fuel_price.rb
364
376
  - lib/earth/fuel/fuel_price/data_miner.rb
365
377
  - lib/earth/fuel/fuel_type.rb
@@ -448,6 +460,7 @@ files:
448
460
  - lib/earth/shipping/shipment_mode/data_miner.rb
449
461
  - lib/earth/version.rb
450
462
  - spec/earth/air/aircraft_spec.rb
463
+ - spec/earth/automobile/automobile_fuel_spec.rb
451
464
  - spec/earth/pet/species_spec.rb
452
465
  - spec/earth_spec.rb
453
466
  - spec/spec_helper.rb
@@ -507,7 +520,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
507
520
  requirements:
508
521
  - - ">="
509
522
  - !ruby/object:Gem::Version
510
- hash: -661468781
523
+ hash: -3794272341704170348
511
524
  segments:
512
525
  - 0
513
526
  version: "0"
@@ -516,7 +529,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
516
529
  requirements:
517
530
  - - ">="
518
531
  - !ruby/object:Gem::Version
519
- hash: -661468781
532
+ hash: -3794272341704170348
520
533
  segments:
521
534
  - 0
522
535
  version: "0"
@@ -527,5 +540,100 @@ rubygems_version: 1.3.7
527
540
  signing_key:
528
541
  specification_version: 3
529
542
  summary: Land, sky, and sea
530
- test_files: []
531
-
543
+ test_files:
544
+ - features/automobile_fuel.feature
545
+ - features/automobile_fuel_type.feature
546
+ - features/automobile_make.feature
547
+ - features/automobile_make_fleet_year.feature
548
+ - features/automobile_make_model.feature
549
+ - features/automobile_make_model_year.feature
550
+ - features/automobile_make_model_year_variant.feature
551
+ - features/automobile_make_year.feature
552
+ - features/automobile_size_class.feature
553
+ - features/automobile_size_class_year.feature
554
+ - features/automobile_type_fuel_age.feature
555
+ - features/automobile_type_fuel_control.feature
556
+ - features/automobile_type_fuel_year.feature
557
+ - features/automobile_type_fuel_year_age.feature
558
+ - features/automobile_type_fuel_year_control.feature
559
+ - features/automobile_type_year.feature
560
+ - features/bus_class.feature
561
+ - features/carrier.feature
562
+ - features/carrier_mode.feature
563
+ - features/computation_platform.feature
564
+ - features/data_center_company.feature
565
+ - features/egrid_region.feature
566
+ - features/egrid_subregion.feature
567
+ - features/flight_segment.feature
568
+ - features/fuel_year.feature
569
+ - features/greenhouse_gas.feature
570
+ - features/rail_class.feature
571
+ - features/server_type.feature
572
+ - features/server_type_alias.feature
573
+ - features/shipment_mode.feature
574
+ - features/support/env.rb
575
+ - features/support/imports/automobile_fuel_bad.csv
576
+ - features/support/imports/automobile_fuel_good.csv
577
+ - features/support/imports/automobile_fuel_type_bad.csv
578
+ - features/support/imports/automobile_fuel_type_good.csv
579
+ - features/support/imports/automobile_make_bad.csv
580
+ - features/support/imports/automobile_make_fleet_year_bad.csv
581
+ - features/support/imports/automobile_make_fleet_year_good.csv
582
+ - features/support/imports/automobile_make_good.csv
583
+ - features/support/imports/automobile_make_model_bad.csv
584
+ - features/support/imports/automobile_make_model_good.csv
585
+ - features/support/imports/automobile_make_model_year_bad.csv
586
+ - features/support/imports/automobile_make_model_year_good.csv
587
+ - features/support/imports/automobile_make_model_year_variant_bad.csv
588
+ - features/support/imports/automobile_make_model_year_variant_good.csv
589
+ - features/support/imports/automobile_make_year_bad.csv
590
+ - features/support/imports/automobile_make_year_good.csv
591
+ - features/support/imports/automobile_size_class_bad.csv
592
+ - features/support/imports/automobile_size_class_good.csv
593
+ - features/support/imports/automobile_size_class_year_bad.csv
594
+ - features/support/imports/automobile_size_class_year_good.csv
595
+ - features/support/imports/automobile_type_fuel_age_bad.csv
596
+ - features/support/imports/automobile_type_fuel_age_good.csv
597
+ - features/support/imports/automobile_type_fuel_control_bad.csv
598
+ - features/support/imports/automobile_type_fuel_control_good.csv
599
+ - features/support/imports/automobile_type_fuel_year_age_bad.csv
600
+ - features/support/imports/automobile_type_fuel_year_age_good.csv
601
+ - features/support/imports/automobile_type_fuel_year_bad.csv
602
+ - features/support/imports/automobile_type_fuel_year_control_bad.csv
603
+ - features/support/imports/automobile_type_fuel_year_control_good.csv
604
+ - features/support/imports/automobile_type_fuel_year_good.csv
605
+ - features/support/imports/automobile_type_year_bad.csv
606
+ - features/support/imports/automobile_type_year_good.csv
607
+ - features/support/imports/bus_class_bad.csv
608
+ - features/support/imports/bus_class_good.csv
609
+ - features/support/imports/carrier_bad.csv
610
+ - features/support/imports/carrier_good.csv
611
+ - features/support/imports/carrier_mode_bad.csv
612
+ - features/support/imports/carrier_mode_good.csv
613
+ - features/support/imports/computation_platform_bad.csv
614
+ - features/support/imports/computation_platform_good.csv
615
+ - features/support/imports/data_center_company_bad.csv
616
+ - features/support/imports/data_center_company_good.csv
617
+ - features/support/imports/egrid_region_bad.csv
618
+ - features/support/imports/egrid_region_good.csv
619
+ - features/support/imports/egrid_subregion_bad.csv
620
+ - features/support/imports/egrid_subregion_good.csv
621
+ - features/support/imports/flight_segment_bad.csv
622
+ - features/support/imports/flight_segment_good.csv
623
+ - features/support/imports/fuel_year_bad.csv
624
+ - features/support/imports/fuel_year_good.csv
625
+ - features/support/imports/greenhouse_gas_bad.csv
626
+ - features/support/imports/greenhouse_gas_good.csv
627
+ - features/support/imports/rail_class_bad.csv
628
+ - features/support/imports/rail_class_good.csv
629
+ - features/support/imports/server_type_alias_bad.csv
630
+ - features/support/imports/server_type_alias_good.csv
631
+ - features/support/imports/server_type_bad.csv
632
+ - features/support/imports/server_type_good.csv
633
+ - features/support/imports/shipment_mode_bad.csv
634
+ - features/support/imports/shipment_mode_good.csv
635
+ - spec/earth/air/aircraft_spec.rb
636
+ - spec/earth/automobile/automobile_fuel_spec.rb
637
+ - spec/earth/pet/species_spec.rb
638
+ - spec/earth_spec.rb
639
+ - spec/spec_helper.rb