earth 0.11.18 → 0.11.19
Sign up to get free protection for your applications and to get access to all the features.
- data/DEVELOPERS.markdown +19 -0
- data/Rakefile +2 -25
- data/errata/electricity/electric_market/nrel_errata.csv +1 -0
- data/errata/electricity/electric_utility/eia_errata.csv +1 -0
- data/lib/earth.rb +3 -1
- data/lib/earth/air/flight_segment.rb +1 -0
- data/lib/earth/air/flight_segment/data_miner.rb +1 -2
- data/lib/earth/electricity.rb +3 -0
- data/lib/earth/electricity/electric_market.rb +12 -0
- data/lib/earth/electricity/electric_market/data_miner.rb +21 -0
- data/lib/earth/electricity/electric_utility.rb +24 -0
- data/lib/earth/electricity/electric_utility/data_miner.rb +26 -0
- data/lib/earth/electricity/green_button_adoption.rb +20 -0
- data/lib/earth/electricity/green_button_adoption/data_miner.rb +19 -0
- data/lib/earth/locality/zip_code.rb +2 -0
- data/lib/earth/rail/national_transit_database_company.rb +3 -2
- data/lib/earth/residence/residential_energy_consumption_survey_response/data_miner.rb +1 -1
- data/lib/earth/version.rb +1 -1
- data/spec/earth/air/aircraft_spec.rb +6 -5
- data/spec/earth/air/airport_spec.rb +5 -6
- data/spec/earth/air/bts_aircraft_spec.rb +7 -6
- data/spec/earth/air/flight_distance_class_spec.rb +5 -6
- data/spec/earth/air/flight_segment_spec.rb +5 -6
- data/spec/earth/automobile/automobile_fuel_spec.rb +11 -4
- data/spec/earth/automobile/automobile_make_model_year_variant_spec.rb +1 -5
- data/spec/earth/automobile/automobile_make_year_fleet_spec.rb +5 -6
- data/spec/earth/automobile/automobile_type_fuel_year_age_spec.rb +14 -8
- data/spec/earth/bus/bus_fuel_control_spec.rb +13 -6
- data/spec/earth/bus/bus_fuel_spec.rb +23 -0
- data/spec/earth/bus/bus_fuel_year_control_spec.rb +16 -9
- data/spec/earth/electricity/electric_market_spec.rb +25 -0
- data/spec/earth/electricity/electric_utility_spec.rb +54 -0
- data/spec/earth/electricity/green_button_adoption_spec.rb +26 -0
- data/spec/earth/fuel/fuel_spec.rb +9 -9
- data/spec/earth/hospitality/commercial_building_energy_consumption_survey_response_spec.rb +4 -6
- data/spec/earth/hospitality/country_lodging_class_spec.rb +5 -6
- data/spec/earth/industry/industry_spec.rb +6 -5
- data/spec/earth/industry/mecs_energy_spec.rb +4 -4
- data/spec/earth/industry/mecs_ratio_spec.rb +4 -4
- data/spec/earth/industry/naics_2002_naics_2007_concordance_spec.rb +6 -5
- data/spec/earth/industry/naics_2002_sic_1987_concordance_spec.rb +6 -5
- data/spec/earth/industry/naics_2002_spec.rb +6 -5
- data/spec/earth/industry/naics_2007_spec.rb +6 -5
- data/spec/earth/industry/sic_1987_spec.rb +4 -6
- data/spec/earth/locality/country_spec.rb +4 -6
- data/spec/earth/locality/state_spec.rb +4 -6
- data/spec/earth/locality/zip_code_spec.rb +4 -6
- data/spec/earth/pet/species_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- metadata +216 -361
- data/features/automobile_fuel.feature +0 -144
- data/features/automobile_make.feature +0 -24
- data/features/automobile_make_model.feature +0 -24
- data/features/automobile_make_model_year.feature +0 -34
- data/features/automobile_make_year.feature +0 -34
- data/features/automobile_size_class.feature +0 -59
- data/features/automobile_size_class_year.feature +0 -34
- data/features/automobile_type_fuel_control.feature +0 -34
- data/features/automobile_type_fuel_year.feature +0 -124
- data/features/automobile_type_fuel_year_age.feature +0 -94
- data/features/automobile_type_fuel_year_control.feature +0 -74
- data/features/automobile_type_year.feature +0 -64
- data/features/bus_class.feature +0 -39
- data/features/bus_fuel.feature +0 -114
- data/features/carrier.feature +0 -64
- data/features/carrier_mode.feature +0 -64
- data/features/computation_carrier.feature +0 -14
- data/features/computation_carrier_instance_class.feature +0 -24
- data/features/egrid_region.feature +0 -20
- data/features/egrid_subregion.feature +0 -134
- data/features/fuel_year.feature +0 -54
- data/features/greenhouse_gas.feature +0 -44
- data/features/rail_class.feature +0 -64
- data/features/shipment_mode.feature +0 -34
- data/features/step_definitions/data_steps.rb +0 -35
- data/features/support/env.rb +0 -19
- data/spec/earth/bus/bus_class_spec.rb +0 -14
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'active_record'
|
2
|
-
require 'active_record/fixtures'
|
3
|
-
|
4
|
-
Given /^an? "([^\"]*)" data import fetches results listed in "(.*)"$/ do |model, file_name|
|
5
|
-
@data_import_model = model.constantize
|
6
|
-
table_name = @data_import_model.table_name
|
7
|
-
|
8
|
-
fixture_path = File.expand_path("features/support/imports/#{file_name}", Dir.pwd)
|
9
|
-
|
10
|
-
fixture = Fixtures.new @data_import_model.connection, table_name, model, fixture_path
|
11
|
-
|
12
|
-
@data_import_model.connection.transaction(:requires_new => true) do
|
13
|
-
fixture.delete_existing_fixtures
|
14
|
-
fixture.insert_fixtures
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
When /^a data import verifies "(.*)"$/ do |verification_step_name|
|
19
|
-
@verification = @data_import_model.data_miner_script.steps.find { |f|
|
20
|
-
f.respond_to?(:description) and f.description == verification_step_name
|
21
|
-
}
|
22
|
-
@verification_result = begin
|
23
|
-
@verification.run
|
24
|
-
true
|
25
|
-
rescue => e
|
26
|
-
false
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
Then /^the verification should be successful$/ do
|
31
|
-
@verification_result.should be_true
|
32
|
-
end
|
33
|
-
Then /^the verification should not be successful$/ do
|
34
|
-
@verification_result.should be_false
|
35
|
-
end
|
data/features/support/env.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler'
|
3
|
-
Bundler.setup
|
4
|
-
require 'logger'
|
5
|
-
require 'active_record'
|
6
|
-
require 'data_miner'
|
7
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
8
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
9
|
-
require 'earth'
|
10
|
-
|
11
|
-
logger = Logger.new 'log/test.log'
|
12
|
-
logger.level = Logger::DEBUG
|
13
|
-
|
14
|
-
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => ':memory:'
|
15
|
-
ActiveRecord::Base.logger = logger
|
16
|
-
|
17
|
-
DataMiner.logger = logger
|
18
|
-
|
19
|
-
Earth.init :all, :apply_schemas => true
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'BusFuel' do
|
4
|
-
before :all do
|
5
|
-
Earth.init :bus, :fuel, :apply_schemas => true
|
6
|
-
end
|
7
|
-
|
8
|
-
describe 'import', :data_miner => true do
|
9
|
-
it 'is related to fuels' do
|
10
|
-
BusFuel.run_data_miner!
|
11
|
-
BusFuel.last.fuel.should_not be_nil
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|