earth 0.11.7 → 0.11.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +30 -0
- data/bin/earth_tester.rb +1 -1
- data/earth.gemspec +3 -3
- data/lib/earth.rb +105 -90
- data/lib/earth/air.rb +3 -12
- data/lib/earth/air/aircraft.rb +9 -9
- data/lib/earth/air/airport.rb +3 -0
- data/lib/earth/air/airport/data_miner.rb +2 -0
- data/lib/earth/air/data_miner.rb +3 -10
- data/lib/earth/air/flight_segment.rb +3 -1
- data/lib/earth/air/flight_segment/data_miner.rb +2 -0
- data/lib/earth/all.rb +3 -13
- data/lib/earth/automobile.rb +3 -18
- data/lib/earth/automobile/automobile_fuel.rb +1 -3
- data/lib/earth/automobile/automobile_fuel/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_make.rb +1 -0
- data/lib/earth/automobile/automobile_make/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_make_model.rb +1 -0
- data/lib/earth/automobile/automobile_make_model/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_make_model_year.rb +1 -0
- data/lib/earth/automobile/automobile_make_model_year/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_make_model_year_variant.rb +1 -0
- data/lib/earth/automobile/automobile_make_model_year_variant/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_make_year.rb +1 -0
- data/lib/earth/automobile/automobile_make_year/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_make_year_fleet.rb +1 -0
- data/lib/earth/automobile/automobile_make_year_fleet/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_model.rb +1 -0
- data/lib/earth/automobile/automobile_model/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_size_class.rb +1 -0
- data/lib/earth/automobile/automobile_size_class/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_size_class_year.rb +1 -0
- data/lib/earth/automobile/automobile_size_class_year/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_type_fuel_control.rb +1 -0
- data/lib/earth/automobile/automobile_type_fuel_control/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_type_fuel_year.rb +1 -0
- data/lib/earth/automobile/automobile_type_fuel_year/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_type_fuel_year_age.rb +1 -0
- data/lib/earth/automobile/automobile_type_fuel_year_age/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_type_fuel_year_control.rb +1 -0
- data/lib/earth/automobile/automobile_type_fuel_year_control/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_type_year.rb +1 -0
- data/lib/earth/automobile/automobile_type_year/data_miner.rb +1 -0
- data/lib/earth/automobile/automobile_year.rb +1 -0
- data/lib/earth/automobile/automobile_year/data_miner.rb +1 -0
- data/lib/earth/automobile/data_miner.rb +3 -18
- data/lib/earth/bus.rb +3 -6
- data/lib/earth/bus/bus_class.rb +1 -0
- data/lib/earth/bus/bus_class/data_miner.rb +1 -0
- data/lib/earth/bus/bus_fuel.rb +1 -0
- data/lib/earth/bus/bus_fuel/data_miner.rb +1 -0
- data/lib/earth/bus/bus_fuel_control.rb +1 -0
- data/lib/earth/bus/bus_fuel_control/data_miner.rb +1 -0
- data/lib/earth/bus/bus_fuel_year_control.rb +1 -0
- data/lib/earth/bus/bus_fuel_year_control/data_miner.rb +1 -0
- data/lib/earth/bus/data_miner.rb +3 -6
- data/lib/earth/computation.rb +3 -5
- data/lib/earth/computation/computation_carrier.rb +1 -0
- data/lib/earth/computation/computation_carrier/data_miner.rb +1 -1
- data/lib/earth/computation/computation_carrier_instance_class.rb +1 -0
- data/lib/earth/computation/computation_carrier_instance_class/data_miner.rb +1 -0
- data/lib/earth/computation/computation_carrier_region.rb +1 -0
- data/lib/earth/computation/computation_carrier_region/data_miner.rb +1 -0
- data/lib/earth/computation/data_miner.rb +3 -5
- data/lib/earth/data_miner.rb +3 -13
- data/lib/earth/diet.rb +3 -2
- data/lib/earth/diet/data_miner.rb +3 -2
- data/lib/earth/eia.rb +11 -13
- data/lib/earth/fuel.rb +3 -5
- data/lib/earth/fuel/data_miner.rb +3 -5
- data/lib/earth/fuel/fuel_price.rb +1 -1
- data/lib/earth/hospitality.rb +3 -5
- data/lib/earth/hospitality/commercial_building_energy_consumption_survey_response.rb +2 -0
- data/lib/earth/hospitality/commercial_building_energy_consumption_survey_response/data_miner.rb +13 -7
- data/lib/earth/hospitality/country_lodging_class.rb +1 -0
- data/lib/earth/hospitality/country_lodging_class/data_miner.rb +4 -2
- data/lib/earth/hospitality/data_miner.rb +3 -4
- data/lib/earth/hospitality/lodging_class.rb +1 -10
- data/lib/earth/hospitality/lodging_class/data_miner.rb +7 -30
- data/lib/earth/hospitality/lodging_property.rb +1 -0
- data/lib/earth/industry.rb +3 -13
- data/lib/earth/industry/cbecs_energy_intensity.rb +5 -49
- data/lib/earth/industry/cbecs_energy_intensity/data_miner.rb +94 -42
- data/lib/earth/industry/data_miner.rb +3 -4
- data/lib/earth/industry/industry.rb +1 -0
- data/lib/earth/industry/industry/data_miner.rb +1 -0
- data/lib/earth/industry/industry_product.rb +1 -0
- data/lib/earth/industry/industry_product_line.rb +1 -0
- data/lib/earth/industry/industry_sector.rb +1 -0
- data/lib/earth/industry/mecs_energy.rb +3 -24
- data/lib/earth/industry/mecs_energy/data_miner.rb +34 -11
- data/lib/earth/industry/mecs_ratio.rb +6 -24
- data/lib/earth/industry/mecs_ratio/data_miner.rb +24 -1
- data/lib/earth/locality.rb +3 -15
- data/lib/earth/locality/census_division.rb +1 -0
- data/lib/earth/locality/census_division/data_miner.rb +1 -0
- data/lib/earth/locality/country.rb +3 -0
- data/lib/earth/locality/country/data_miner.rb +5 -1
- data/lib/earth/locality/data_miner.rb +3 -15
- data/lib/earth/locality/egrid_subregion.rb +1 -0
- data/lib/earth/locality/egrid_subregion/data_miner.rb +1 -0
- data/lib/earth/locality/state/data_miner.rb +11 -11
- data/lib/earth/locality/zip_code.rb +6 -0
- data/lib/earth/pet.rb +3 -4
- data/lib/earth/pet/data_miner.rb +3 -4
- data/lib/earth/rail.rb +3 -15
- data/lib/earth/rail/country_rail_class.rb +1 -0
- data/lib/earth/rail/country_rail_class/data_miner.rb +1 -0
- data/lib/earth/rail/country_rail_traction.rb +2 -0
- data/lib/earth/rail/country_rail_traction/data_miner.rb +2 -0
- data/lib/earth/rail/country_rail_traction_class.rb +2 -0
- data/lib/earth/rail/country_rail_traction_class/data_miner.rb +2 -0
- data/lib/earth/rail/data_miner.rb +3 -16
- data/lib/earth/rail/national_transit_database_company.rb +1 -0
- data/lib/earth/rail/national_transit_database_company/data_miner.rb +1 -0
- data/lib/earth/rail/national_transit_database_record.rb +1 -0
- data/lib/earth/rail/national_transit_database_record/data_miner.rb +1 -0
- data/lib/earth/rail/rail_company.rb +2 -0
- data/lib/earth/rail/rail_company/data_miner.rb +2 -0
- data/lib/earth/rail/rail_company_traction.rb +1 -0
- data/lib/earth/rail/rail_company_traction/data_miner.rb +1 -0
- data/lib/earth/rail/rail_company_traction_class.rb +1 -0
- data/lib/earth/rail/rail_company_traction_class/data_miner.rb +1 -0
- data/lib/earth/rail/rail_fuel.rb +1 -0
- data/lib/earth/rail/rail_fuel/data_miner.rb +1 -0
- data/lib/earth/residence.rb +3 -11
- data/lib/earth/residence/data_miner.rb +3 -11
- data/lib/earth/residence/residence_fuel_price.rb +1 -0
- data/lib/earth/residence/residence_fuel_price/data_miner.rb +1 -0
- data/lib/earth/residence/residential_energy_consumption_survey_response.rb +1 -0
- data/lib/earth/residence/residential_energy_consumption_survey_response/data_miner.rb +1 -0
- data/lib/earth/shipping.rb +3 -3
- data/lib/earth/shipping/data_miner.rb +3 -3
- data/lib/earth/version.rb +1 -1
- data/spec/earth/industry/mecs_energy_spec.rb +18 -0
- data/spec/earth_spec.rb +18 -29
- data/test/test_aircraft_match.rb +142 -142
- data/vendor/geokit-rails/.gitignore +2 -0
- data/vendor/geokit-rails/CHANGELOG.rdoc +4 -1
- data/vendor/geokit-rails/README.markdown +11 -3
- data/vendor/geokit-rails/about.yml +2 -0
- data/vendor/geokit-rails/lib/geokit-rails.rb +7 -4
- data/vendor/geokit-rails/lib/geokit-rails/acts_as_mappable.rb +15 -2
- data/vendor/geokit-rails/lib/geokit-rails/adapters/abstract.rb +1 -1
- data/vendor/geokit-rails/lib/geokit-rails/adapters/mysql2.rb +22 -0
- data/vendor/geokit-rails/test/database.yml +5 -0
- data/vendor/geokit-rails/test/ip_geocode_lookup_test.rb +1 -1
- data/vendor/geokit-rails/test/tasks.rake +2 -2
- metadata +179 -191
- data/lib/earth/hospitality/census_region_lodging_class.rb +0 -16
- data/lib/earth/hospitality/census_region_lodging_class/data_miner.rb +0 -40
data/lib/earth/automobile.rb
CHANGED
@@ -1,18 +1,3 @@
|
|
1
|
-
|
2
|
-
require 'earth
|
3
|
-
|
4
|
-
require 'earth/automobile/automobile_make_year_fleet'
|
5
|
-
require 'earth/automobile/automobile_make_model'
|
6
|
-
require 'earth/automobile/automobile_make_model_year'
|
7
|
-
require 'earth/automobile/automobile_make_model_year_variant'
|
8
|
-
require 'earth/automobile/automobile_model'
|
9
|
-
require 'earth/automobile/automobile_size_class'
|
10
|
-
require 'earth/automobile/automobile_size_class_year'
|
11
|
-
require 'earth/automobile/automobile_type_year'
|
12
|
-
require 'earth/automobile/automobile_type_fuel_control'
|
13
|
-
require 'earth/automobile/automobile_type_fuel_year'
|
14
|
-
require 'earth/automobile/automobile_type_fuel_year_age'
|
15
|
-
require 'earth/automobile/automobile_type_fuel_year_control'
|
16
|
-
require 'earth/automobile/automobile_year'
|
17
|
-
|
18
|
-
require 'earth/fuel'
|
1
|
+
# lib/earth/automobile.rb
|
2
|
+
require 'earth'
|
3
|
+
Earth.require_related __FILE__
|
@@ -1,18 +1,3 @@
|
|
1
|
-
|
2
|
-
require 'earth
|
3
|
-
|
4
|
-
require 'earth/automobile/automobile_make_year_fleet/data_miner'
|
5
|
-
require 'earth/automobile/automobile_make_model/data_miner'
|
6
|
-
require 'earth/automobile/automobile_make_model_year/data_miner'
|
7
|
-
require 'earth/automobile/automobile_make_model_year_variant/data_miner'
|
8
|
-
require 'earth/automobile/automobile_size_class/data_miner'
|
9
|
-
require 'earth/automobile/automobile_size_class_year/data_miner'
|
10
|
-
require 'earth/automobile/automobile_type_year/data_miner'
|
11
|
-
require 'earth/automobile/automobile_type_fuel_control/data_miner'
|
12
|
-
require 'earth/automobile/automobile_type_fuel_year/data_miner'
|
13
|
-
require 'earth/automobile/automobile_type_fuel_year_age/data_miner'
|
14
|
-
require 'earth/automobile/automobile_type_fuel_year_control/data_miner'
|
15
|
-
require 'earth/automobile/automobile_model/data_miner'
|
16
|
-
require 'earth/automobile/automobile_year/data_miner'
|
17
|
-
|
18
|
-
require 'earth/fuel/data_miner'
|
1
|
+
# lib/earth/automobile/data_miner.rb
|
2
|
+
require 'earth'
|
3
|
+
Earth.require_related __FILE__
|
data/lib/earth/bus.rb
CHANGED
data/lib/earth/bus/bus_class.rb
CHANGED
data/lib/earth/bus/bus_fuel.rb
CHANGED
data/lib/earth/bus/data_miner.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
|
2
|
-
require 'earth
|
3
|
-
|
4
|
-
require 'earth/bus/bus_fuel_year_control/data_miner'
|
5
|
-
|
6
|
-
require 'earth/fuel/data_miner'
|
1
|
+
# lib/earth/bus/data_miner.rb
|
2
|
+
require 'earth'
|
3
|
+
Earth.require_related __FILE__
|
data/lib/earth/computation.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
require 'earth
|
3
|
-
|
4
|
-
|
5
|
-
require 'earth/locality'
|
1
|
+
# lib/earth/computation.rb
|
2
|
+
require 'earth'
|
3
|
+
Earth.require_related __FILE__
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'earth/locality/data_miner'
|
1
2
|
ComputationCarrier.class_eval do
|
2
3
|
data_miner do
|
3
4
|
import "a list of computation carriers and their power usage effectiveness",
|
@@ -5,6 +6,5 @@ ComputationCarrier.class_eval do
|
|
5
6
|
key 'name'
|
6
7
|
store 'power_usage_effectiveness'
|
7
8
|
end
|
8
|
-
|
9
9
|
end
|
10
10
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
require 'earth
|
3
|
-
|
4
|
-
|
5
|
-
require 'earth/locality/data_miner'
|
1
|
+
# lib/earth/computation/data_miner.rb
|
2
|
+
require 'earth'
|
3
|
+
Earth.require_related __FILE__
|
data/lib/earth/data_miner.rb
CHANGED
@@ -1,13 +1,3 @@
|
|
1
|
-
|
2
|
-
require 'earth
|
3
|
-
|
4
|
-
require 'earth/computation/data_miner'
|
5
|
-
require 'earth/diet/data_miner'
|
6
|
-
require 'earth/fuel/data_miner'
|
7
|
-
require 'earth/hospitality/data_miner'
|
8
|
-
require 'earth/locality/data_miner'
|
9
|
-
require 'earth/pet/data_miner'
|
10
|
-
require 'earth/rail/data_miner'
|
11
|
-
require 'earth/residence/data_miner'
|
12
|
-
require 'earth/shipping/data_miner'
|
13
|
-
require 'earth/industry/data_miner'
|
1
|
+
# lib/earth/data_miner.rb
|
2
|
+
require 'earth'
|
3
|
+
Earth.require_all :load_data_miner => true
|
data/lib/earth/diet.rb
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
require 'earth
|
1
|
+
# lib/earth/diet.rb
|
2
|
+
require 'earth'
|
3
|
+
Earth.require_related __FILE__
|
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
require 'earth
|
1
|
+
# lib/earth/diet/data_miner.rb
|
2
|
+
require 'earth'
|
3
|
+
Earth.require_related __FILE__
|
data/lib/earth/eia.rb
CHANGED
@@ -1,23 +1,21 @@
|
|
1
|
+
require 'earth'
|
1
2
|
module Earth
|
2
3
|
module EIA
|
3
4
|
extend self
|
4
5
|
|
5
6
|
def normalize(model, fields)
|
6
7
|
model.all.each do |record|
|
7
|
-
fields.each do |
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
value
|
17
|
-
end
|
18
|
-
record.send "#{field}=", normalized_value
|
8
|
+
fields.each do |k|
|
9
|
+
v = record.send k
|
10
|
+
normalized_v = case v
|
11
|
+
when 'Q', 'W', '*'
|
12
|
+
0
|
13
|
+
else
|
14
|
+
v
|
15
|
+
end
|
16
|
+
record.send "#{k}=", normalized_v
|
19
17
|
end
|
20
|
-
record.save
|
18
|
+
record.save!
|
21
19
|
end
|
22
20
|
end
|
23
21
|
end
|