data_miner 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/data_miner/process.rb +1 -1
- data/lib/data_miner/version.rb +1 -1
- data/test/helper.rb +2 -294
- data/test/support/test_database.rb +309 -0
- data/test/{test_attribute.rb → test_data_miner_attribute.rb} +4 -1
- data/test/test_data_miner_process.rb +18 -0
- data/test/{test_verify.rb → test_data_miner_verify.rb} +1 -1
- data/test/test_old_syntax.rb +3 -0
- metadata +10 -32
data/lib/data_miner/process.rb
CHANGED
data/lib/data_miner/version.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -19,302 +19,10 @@ require 'errata'
|
|
19
19
|
|
20
20
|
ENV['WIP'] = 'true' if ENV['ALL'] == 'true'
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
'database' => 'data_miner_test',
|
25
|
-
'username' => 'root',
|
26
|
-
'password' => 'password'
|
27
|
-
)
|
28
|
-
|
29
|
-
Dir.glob(File.expand_path('support/*.rb', File.dirname(__FILE__))).each do |lib|
|
30
|
-
require lib
|
31
|
-
end
|
22
|
+
$:.push File.dirname(__FILE__)
|
23
|
+
require 'support/test_database'
|
32
24
|
|
33
25
|
ActiveSupport::Inflector.inflections do |inflect|
|
34
26
|
inflect.uncountable %w{ aircraft aircraft_deux census_division_deux census_division_trois }
|
35
27
|
end
|
36
28
|
|
37
|
-
ActiveRecord::Schema.define(:version => 20090819143429) do
|
38
|
-
create_table "t100_flight_segments", :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
39
|
-
t.integer "departures_performed"
|
40
|
-
t.integer "payload"
|
41
|
-
t.integer "seats"
|
42
|
-
t.integer "passengers"
|
43
|
-
t.integer "freight"
|
44
|
-
t.integer "mail"
|
45
|
-
t.integer "ramp_to_ramp"
|
46
|
-
t.integer "air_time"
|
47
|
-
t.float "load_factor"
|
48
|
-
t.float "freight_share"
|
49
|
-
t.integer "distance"
|
50
|
-
t.integer "departures_scheduled"
|
51
|
-
t.string "unique_carrier"
|
52
|
-
t.integer "dot_airline_id"
|
53
|
-
t.string "unique_carrier_name"
|
54
|
-
t.string "unique_carrier_entity"
|
55
|
-
t.string "region"
|
56
|
-
t.string "carrier"
|
57
|
-
t.string "carrier_name"
|
58
|
-
t.integer "carrier_group"
|
59
|
-
t.integer "carrier_group_new"
|
60
|
-
t.string "origin_airport_iata"
|
61
|
-
t.string "origin_city_name"
|
62
|
-
t.integer "origin_city_num"
|
63
|
-
t.string "origin_state_abr"
|
64
|
-
t.string "origin_state_fips"
|
65
|
-
t.string "origin_state_nm"
|
66
|
-
t.string "origin_country_iso_3166"
|
67
|
-
t.string "origin_country_name"
|
68
|
-
t.integer "origin_wac"
|
69
|
-
t.string "dest_airport_iata"
|
70
|
-
t.string "dest_city_name"
|
71
|
-
t.integer "dest_city_num"
|
72
|
-
t.string "dest_state_abr"
|
73
|
-
t.string "dest_state_fips"
|
74
|
-
t.string "dest_state_nm"
|
75
|
-
t.string "dest_country_iso_3166"
|
76
|
-
t.string "dest_country_name"
|
77
|
-
t.integer "dest_wac"
|
78
|
-
t.integer "bts_aircraft_group"
|
79
|
-
t.integer "bts_aircraft_type"
|
80
|
-
t.integer "bts_aircraft_config"
|
81
|
-
t.integer "year"
|
82
|
-
t.integer "quarter"
|
83
|
-
t.integer "month"
|
84
|
-
t.integer "bts_distance_group"
|
85
|
-
t.string "bts_service_class"
|
86
|
-
t.string "data_source"
|
87
|
-
t.float "seats_per_departure"
|
88
|
-
|
89
|
-
t.string 'payload_units'
|
90
|
-
t.string 'freight_units'
|
91
|
-
t.string 'mail_units'
|
92
|
-
t.string 'distance_units'
|
93
|
-
|
94
|
-
t.datetime "created_at"
|
95
|
-
t.datetime "updated_at"
|
96
|
-
|
97
|
-
t.string "row_hash"
|
98
|
-
end
|
99
|
-
execute 'ALTER TABLE t100_flight_segments ADD PRIMARY KEY (row_hash);'
|
100
|
-
|
101
|
-
create_table 'tapped_airports', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
102
|
-
t.string 'i_am_just_here_to_get_in_the_way'
|
103
|
-
end
|
104
|
-
|
105
|
-
create_table 'airports', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
106
|
-
t.string 'iata_code'
|
107
|
-
t.string 'name'
|
108
|
-
t.string 'city'
|
109
|
-
t.string 'country_name'
|
110
|
-
t.float 'latitude'
|
111
|
-
t.float 'longitude'
|
112
|
-
t.datetime 'created_at'
|
113
|
-
t.datetime 'updated_at'
|
114
|
-
end
|
115
|
-
execute 'ALTER TABLE airports ADD PRIMARY KEY (iata_code);'
|
116
|
-
|
117
|
-
create_table "countries", :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
118
|
-
t.string "iso_3166"
|
119
|
-
t.string "name"
|
120
|
-
t.datetime "created_at"
|
121
|
-
t.datetime "updated_at"
|
122
|
-
end
|
123
|
-
execute "ALTER TABLE countries ADD PRIMARY KEY (iso_3166);"
|
124
|
-
|
125
|
-
create_table "census_regions", :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
126
|
-
t.integer "number"
|
127
|
-
t.string "name"
|
128
|
-
t.datetime "updated_at"
|
129
|
-
t.datetime "created_at"
|
130
|
-
end
|
131
|
-
execute "ALTER TABLE census_regions ADD PRIMARY KEY (number);"
|
132
|
-
|
133
|
-
create_table 'census_divisions', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
134
|
-
t.integer 'number'
|
135
|
-
t.string 'name'
|
136
|
-
t.datetime 'updated_at'
|
137
|
-
t.datetime 'created_at'
|
138
|
-
t.string 'census_region_name'
|
139
|
-
t.integer 'census_region_number'
|
140
|
-
|
141
|
-
end
|
142
|
-
execute 'ALTER TABLE census_divisions ADD PRIMARY KEY (number);'
|
143
|
-
|
144
|
-
create_table 'census_division_deux', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
145
|
-
t.integer 'number'
|
146
|
-
t.string 'name'
|
147
|
-
t.datetime 'updated_at'
|
148
|
-
t.datetime 'created_at'
|
149
|
-
t.string 'census_region_name'
|
150
|
-
t.integer 'census_region_number'
|
151
|
-
|
152
|
-
end
|
153
|
-
execute 'ALTER TABLE census_division_deux ADD PRIMARY KEY (number);'
|
154
|
-
|
155
|
-
create_table 'crosscalling_census_divisions', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
156
|
-
t.integer 'number'
|
157
|
-
t.string 'name'
|
158
|
-
t.datetime 'updated_at'
|
159
|
-
t.datetime 'created_at'
|
160
|
-
t.string 'census_region_name'
|
161
|
-
t.integer 'census_region_number'
|
162
|
-
|
163
|
-
end
|
164
|
-
execute 'ALTER TABLE crosscalling_census_divisions ADD PRIMARY KEY (number);'
|
165
|
-
|
166
|
-
create_table "automobile_variants", :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
167
|
-
t.float "fuel_efficiency_city"
|
168
|
-
t.float "fuel_efficiency_highway"
|
169
|
-
t.string "make_name"
|
170
|
-
t.string "model_name"
|
171
|
-
t.string "year"
|
172
|
-
t.string "fuel_type_code"
|
173
|
-
t.datetime "updated_at"
|
174
|
-
t.datetime "created_at"
|
175
|
-
t.string "transmission"
|
176
|
-
t.string "drive"
|
177
|
-
t.boolean "turbo"
|
178
|
-
t.boolean "supercharger"
|
179
|
-
t.integer "cylinders"
|
180
|
-
t.float "displacement"
|
181
|
-
t.float "raw_fuel_efficiency_city"
|
182
|
-
t.float "raw_fuel_efficiency_highway"
|
183
|
-
t.integer "carline_mfr_code"
|
184
|
-
t.integer "vi_mfr_code"
|
185
|
-
t.integer "carline_code"
|
186
|
-
t.integer "carline_class_code"
|
187
|
-
t.boolean "injection"
|
188
|
-
t.string "carline_class_name"
|
189
|
-
t.string "speeds"
|
190
|
-
|
191
|
-
t.string 'raw_fuel_efficiency_highway_units'
|
192
|
-
t.string 'raw_fuel_efficiency_city_units'
|
193
|
-
t.string 'fuel_efficiency_highway_units'
|
194
|
-
t.string 'fuel_efficiency_city_units'
|
195
|
-
|
196
|
-
t.string "row_hash"
|
197
|
-
end
|
198
|
-
execute "ALTER TABLE automobile_variants ADD PRIMARY KEY (row_hash);"
|
199
|
-
|
200
|
-
create_table "automobile_fuel_types", :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
201
|
-
t.string "name"
|
202
|
-
t.datetime "created_at"
|
203
|
-
t.datetime "updated_at"
|
204
|
-
t.float "emission_factor"
|
205
|
-
t.float "annual_distance"
|
206
|
-
t.string "code"
|
207
|
-
end
|
208
|
-
execute "ALTER TABLE automobile_fuel_types ADD PRIMARY KEY (code);"
|
209
|
-
|
210
|
-
create_table "residential_energy_consumption_survey_responses", :options => 'ENGINE=InnoDB default charset=utf8', :id => false, :force => true do |t|
|
211
|
-
t.integer "department_of_energy_identifier"
|
212
|
-
|
213
|
-
t.string "residence_class"
|
214
|
-
t.date "construction_year"
|
215
|
-
t.string "construction_period"
|
216
|
-
t.string "urbanity"
|
217
|
-
t.string "dishwasher_use"
|
218
|
-
t.string "central_ac_use"
|
219
|
-
t.string "window_ac_use"
|
220
|
-
t.string "clothes_washer_use"
|
221
|
-
t.string "clothes_dryer_use"
|
222
|
-
|
223
|
-
t.integer "census_division_number"
|
224
|
-
t.string "census_division_name"
|
225
|
-
t.integer "census_region_number"
|
226
|
-
t.string "census_region_name"
|
227
|
-
|
228
|
-
t.float "rooms"
|
229
|
-
t.float "floorspace"
|
230
|
-
t.integer "residents"
|
231
|
-
t.boolean "ownership"
|
232
|
-
t.boolean "thermostat_programmability"
|
233
|
-
t.integer "refrigerator_count"
|
234
|
-
t.integer "freezer_count"
|
235
|
-
t.float "annual_energy_from_fuel_oil_for_heating_space"
|
236
|
-
t.float "annual_energy_from_fuel_oil_for_heating_water"
|
237
|
-
t.float "annual_energy_from_fuel_oil_for_appliances"
|
238
|
-
t.float "annual_energy_from_natural_gas_for_heating_space"
|
239
|
-
t.float "annual_energy_from_natural_gas_for_heating_water"
|
240
|
-
t.float "annual_energy_from_natural_gas_for_appliances"
|
241
|
-
t.float "annual_energy_from_propane_for_heating_space"
|
242
|
-
t.float "annual_energy_from_propane_for_heating_water"
|
243
|
-
t.float "annual_energy_from_propane_for_appliances"
|
244
|
-
t.float "annual_energy_from_wood"
|
245
|
-
t.float "annual_energy_from_kerosene"
|
246
|
-
t.float "annual_energy_from_electricity_for_clothes_driers"
|
247
|
-
t.float "annual_energy_from_electricity_for_dishwashers"
|
248
|
-
t.float "annual_energy_from_electricity_for_freezers"
|
249
|
-
t.float "annual_energy_from_electricity_for_refrigerators"
|
250
|
-
t.float "annual_energy_from_electricity_for_air_conditioners"
|
251
|
-
t.float "annual_energy_from_electricity_for_heating_space"
|
252
|
-
t.float "annual_energy_from_electricity_for_heating_water"
|
253
|
-
t.float "annual_energy_from_electricity_for_other_appliances"
|
254
|
-
t.float "weighting"
|
255
|
-
t.float "lighting_use"
|
256
|
-
t.float "lighting_efficiency"
|
257
|
-
t.integer "heating_degree_days"
|
258
|
-
t.integer "cooling_degree_days"
|
259
|
-
t.integer "total_rooms"
|
260
|
-
t.integer "bathrooms"
|
261
|
-
t.integer "halfbaths"
|
262
|
-
t.integer "heated_garage"
|
263
|
-
t.integer "attached_1car_garage"
|
264
|
-
t.integer "detached_1car_garage"
|
265
|
-
t.integer "attached_2car_garage"
|
266
|
-
t.integer "detached_2car_garage"
|
267
|
-
t.integer "attached_3car_garage"
|
268
|
-
t.integer "detached_3car_garage"
|
269
|
-
t.integer "lights_on_1_to_4_hours"
|
270
|
-
t.integer "efficient_lights_on_1_to_4_hours"
|
271
|
-
t.integer "lights_on_4_to_12_hours"
|
272
|
-
t.integer "efficient_lights_on_4_to_12_hours"
|
273
|
-
t.integer "lights_on_over_12_hours"
|
274
|
-
t.integer "efficient_lights_on_over_12_hours"
|
275
|
-
t.integer "outdoor_all_night_lights"
|
276
|
-
t.integer "outdoor_all_night_gas_lights"
|
277
|
-
|
278
|
-
t.datetime "created_at"
|
279
|
-
t.datetime "updated_at"
|
280
|
-
end
|
281
|
-
execute "ALTER TABLE residential_energy_consumption_survey_responses ADD PRIMARY KEY (department_of_energy_identifier);"
|
282
|
-
|
283
|
-
create_table 'aircraft', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
284
|
-
t.string 'icao_code'
|
285
|
-
t.string 'manufacturer_name'
|
286
|
-
t.string 'name'
|
287
|
-
|
288
|
-
t.string "bts_name"
|
289
|
-
t.string "bts_aircraft_type_code"
|
290
|
-
|
291
|
-
t.string 'brighter_planet_aircraft_class_code'
|
292
|
-
# t.float 'm3'
|
293
|
-
# t.float 'm2'
|
294
|
-
# t.float 'm1'
|
295
|
-
# t.float 'endpoint_fuel'
|
296
|
-
t.datetime 'updated_at'
|
297
|
-
t.datetime 'created_at'
|
298
|
-
end
|
299
|
-
execute 'ALTER TABLE aircraft ADD PRIMARY KEY (icao_code);'
|
300
|
-
|
301
|
-
create_table 'aircraft_deux', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
302
|
-
t.string 'icao_code'
|
303
|
-
t.string 'manufacturer_name'
|
304
|
-
t.string 'name'
|
305
|
-
|
306
|
-
t.string "bts_name"
|
307
|
-
t.string "bts_aircraft_type_code"
|
308
|
-
|
309
|
-
# t.string 'brighter_planet_aircraft_class_code'
|
310
|
-
# t.float 'm3'
|
311
|
-
# t.float 'm2'
|
312
|
-
# t.float 'm1'
|
313
|
-
# t.float 'endpoint_fuel'
|
314
|
-
t.datetime 'updated_at'
|
315
|
-
t.datetime 'created_at'
|
316
|
-
end
|
317
|
-
execute 'ALTER TABLE aircraft_deux ADD PRIMARY KEY (icao_code);'
|
318
|
-
end
|
319
|
-
|
320
|
-
DataMiner::Run.create_tables
|
@@ -0,0 +1,309 @@
|
|
1
|
+
module TestDatabase
|
2
|
+
extend self
|
3
|
+
|
4
|
+
def connect
|
5
|
+
@connection ||= ActiveRecord::Base.establish_connection(
|
6
|
+
'adapter' => 'mysql',
|
7
|
+
'database' => 'data_miner_test',
|
8
|
+
'username' => 'root',
|
9
|
+
'password' => 'password'
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
def load_schema
|
14
|
+
connect
|
15
|
+
|
16
|
+
ActiveRecord::Schema.define(:version => 20090819143429) do
|
17
|
+
create_table "t100_flight_segments", :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
18
|
+
t.integer "departures_performed"
|
19
|
+
t.integer "payload"
|
20
|
+
t.integer "seats"
|
21
|
+
t.integer "passengers"
|
22
|
+
t.integer "freight"
|
23
|
+
t.integer "mail"
|
24
|
+
t.integer "ramp_to_ramp"
|
25
|
+
t.integer "air_time"
|
26
|
+
t.float "load_factor"
|
27
|
+
t.float "freight_share"
|
28
|
+
t.integer "distance"
|
29
|
+
t.integer "departures_scheduled"
|
30
|
+
t.string "unique_carrier"
|
31
|
+
t.integer "dot_airline_id"
|
32
|
+
t.string "unique_carrier_name"
|
33
|
+
t.string "unique_carrier_entity"
|
34
|
+
t.string "region"
|
35
|
+
t.string "carrier"
|
36
|
+
t.string "carrier_name"
|
37
|
+
t.integer "carrier_group"
|
38
|
+
t.integer "carrier_group_new"
|
39
|
+
t.string "origin_airport_iata"
|
40
|
+
t.string "origin_city_name"
|
41
|
+
t.integer "origin_city_num"
|
42
|
+
t.string "origin_state_abr"
|
43
|
+
t.string "origin_state_fips"
|
44
|
+
t.string "origin_state_nm"
|
45
|
+
t.string "origin_country_iso_3166"
|
46
|
+
t.string "origin_country_name"
|
47
|
+
t.integer "origin_wac"
|
48
|
+
t.string "dest_airport_iata"
|
49
|
+
t.string "dest_city_name"
|
50
|
+
t.integer "dest_city_num"
|
51
|
+
t.string "dest_state_abr"
|
52
|
+
t.string "dest_state_fips"
|
53
|
+
t.string "dest_state_nm"
|
54
|
+
t.string "dest_country_iso_3166"
|
55
|
+
t.string "dest_country_name"
|
56
|
+
t.integer "dest_wac"
|
57
|
+
t.integer "bts_aircraft_group"
|
58
|
+
t.integer "bts_aircraft_type"
|
59
|
+
t.integer "bts_aircraft_config"
|
60
|
+
t.integer "year"
|
61
|
+
t.integer "quarter"
|
62
|
+
t.integer "month"
|
63
|
+
t.integer "bts_distance_group"
|
64
|
+
t.string "bts_service_class"
|
65
|
+
t.string "data_source"
|
66
|
+
t.float "seats_per_departure"
|
67
|
+
|
68
|
+
t.string 'payload_units'
|
69
|
+
t.string 'freight_units'
|
70
|
+
t.string 'mail_units'
|
71
|
+
t.string 'distance_units'
|
72
|
+
|
73
|
+
t.datetime "created_at"
|
74
|
+
t.datetime "updated_at"
|
75
|
+
|
76
|
+
t.string "row_hash"
|
77
|
+
end
|
78
|
+
execute 'ALTER TABLE t100_flight_segments ADD PRIMARY KEY (row_hash);'
|
79
|
+
|
80
|
+
create_table 'tapped_airports', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
81
|
+
t.string 'i_am_just_here_to_get_in_the_way'
|
82
|
+
end
|
83
|
+
|
84
|
+
create_table 'airports', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
85
|
+
t.string 'iata_code'
|
86
|
+
t.string 'name'
|
87
|
+
t.string 'city'
|
88
|
+
t.string 'country_name'
|
89
|
+
t.float 'latitude'
|
90
|
+
t.float 'longitude'
|
91
|
+
t.datetime 'created_at'
|
92
|
+
t.datetime 'updated_at'
|
93
|
+
end
|
94
|
+
execute 'ALTER TABLE airports ADD PRIMARY KEY (iata_code);'
|
95
|
+
|
96
|
+
create_table "countries", :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
97
|
+
t.string "iso_3166"
|
98
|
+
t.string "name"
|
99
|
+
t.datetime "created_at"
|
100
|
+
t.datetime "updated_at"
|
101
|
+
end
|
102
|
+
execute "ALTER TABLE countries ADD PRIMARY KEY (iso_3166);"
|
103
|
+
|
104
|
+
create_table "census_regions", :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
105
|
+
t.integer "number"
|
106
|
+
t.string "name"
|
107
|
+
t.datetime "updated_at"
|
108
|
+
t.datetime "created_at"
|
109
|
+
end
|
110
|
+
execute "ALTER TABLE census_regions ADD PRIMARY KEY (number);"
|
111
|
+
|
112
|
+
create_table 'census_divisions', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
113
|
+
t.integer 'number'
|
114
|
+
t.string 'name'
|
115
|
+
t.datetime 'updated_at'
|
116
|
+
t.datetime 'created_at'
|
117
|
+
t.string 'census_region_name'
|
118
|
+
t.integer 'census_region_number'
|
119
|
+
|
120
|
+
end
|
121
|
+
execute 'ALTER TABLE census_divisions ADD PRIMARY KEY (number);'
|
122
|
+
|
123
|
+
create_table 'census_division_deux', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
124
|
+
t.integer 'number'
|
125
|
+
t.string 'name'
|
126
|
+
t.datetime 'updated_at'
|
127
|
+
t.datetime 'created_at'
|
128
|
+
t.string 'census_region_name'
|
129
|
+
t.integer 'census_region_number'
|
130
|
+
|
131
|
+
end
|
132
|
+
execute 'ALTER TABLE census_division_deux ADD PRIMARY KEY (number);'
|
133
|
+
|
134
|
+
create_table 'crosscalling_census_divisions', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
135
|
+
t.integer 'number'
|
136
|
+
t.string 'name'
|
137
|
+
t.datetime 'updated_at'
|
138
|
+
t.datetime 'created_at'
|
139
|
+
t.string 'census_region_name'
|
140
|
+
t.integer 'census_region_number'
|
141
|
+
|
142
|
+
end
|
143
|
+
execute 'ALTER TABLE crosscalling_census_divisions ADD PRIMARY KEY (number);'
|
144
|
+
|
145
|
+
create_table "automobile_variants", :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
146
|
+
t.float "fuel_efficiency_city"
|
147
|
+
t.float "fuel_efficiency_highway"
|
148
|
+
t.string "make_name"
|
149
|
+
t.string "model_name"
|
150
|
+
t.string "year"
|
151
|
+
t.string "fuel_type_code"
|
152
|
+
t.datetime "updated_at"
|
153
|
+
t.datetime "created_at"
|
154
|
+
t.string "transmission"
|
155
|
+
t.string "drive"
|
156
|
+
t.boolean "turbo"
|
157
|
+
t.boolean "supercharger"
|
158
|
+
t.integer "cylinders"
|
159
|
+
t.float "displacement"
|
160
|
+
t.float "raw_fuel_efficiency_city"
|
161
|
+
t.float "raw_fuel_efficiency_highway"
|
162
|
+
t.integer "carline_mfr_code"
|
163
|
+
t.integer "vi_mfr_code"
|
164
|
+
t.integer "carline_code"
|
165
|
+
t.integer "carline_class_code"
|
166
|
+
t.boolean "injection"
|
167
|
+
t.string "carline_class_name"
|
168
|
+
t.string "speeds"
|
169
|
+
|
170
|
+
t.string 'raw_fuel_efficiency_highway_units'
|
171
|
+
t.string 'raw_fuel_efficiency_city_units'
|
172
|
+
t.string 'fuel_efficiency_highway_units'
|
173
|
+
t.string 'fuel_efficiency_city_units'
|
174
|
+
|
175
|
+
t.string "row_hash"
|
176
|
+
end
|
177
|
+
execute "ALTER TABLE automobile_variants ADD PRIMARY KEY (row_hash);"
|
178
|
+
|
179
|
+
create_table "automobile_fuel_types", :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
180
|
+
t.string "name"
|
181
|
+
t.datetime "created_at"
|
182
|
+
t.datetime "updated_at"
|
183
|
+
t.float "emission_factor"
|
184
|
+
t.float "annual_distance"
|
185
|
+
t.string "code"
|
186
|
+
end
|
187
|
+
execute "ALTER TABLE automobile_fuel_types ADD PRIMARY KEY (code);"
|
188
|
+
|
189
|
+
create_table "residential_energy_consumption_survey_responses", :options => 'ENGINE=InnoDB default charset=utf8', :id => false, :force => true do |t|
|
190
|
+
t.integer "department_of_energy_identifier"
|
191
|
+
|
192
|
+
t.string "residence_class"
|
193
|
+
t.date "construction_year"
|
194
|
+
t.string "construction_period"
|
195
|
+
t.string "urbanity"
|
196
|
+
t.string "dishwasher_use"
|
197
|
+
t.string "central_ac_use"
|
198
|
+
t.string "window_ac_use"
|
199
|
+
t.string "clothes_washer_use"
|
200
|
+
t.string "clothes_dryer_use"
|
201
|
+
|
202
|
+
t.integer "census_division_number"
|
203
|
+
t.string "census_division_name"
|
204
|
+
t.integer "census_region_number"
|
205
|
+
t.string "census_region_name"
|
206
|
+
|
207
|
+
t.float "rooms"
|
208
|
+
t.float "floorspace"
|
209
|
+
t.integer "residents"
|
210
|
+
t.boolean "ownership"
|
211
|
+
t.boolean "thermostat_programmability"
|
212
|
+
t.integer "refrigerator_count"
|
213
|
+
t.integer "freezer_count"
|
214
|
+
t.float "annual_energy_from_fuel_oil_for_heating_space"
|
215
|
+
t.float "annual_energy_from_fuel_oil_for_heating_water"
|
216
|
+
t.float "annual_energy_from_fuel_oil_for_appliances"
|
217
|
+
t.float "annual_energy_from_natural_gas_for_heating_space"
|
218
|
+
t.float "annual_energy_from_natural_gas_for_heating_water"
|
219
|
+
t.float "annual_energy_from_natural_gas_for_appliances"
|
220
|
+
t.float "annual_energy_from_propane_for_heating_space"
|
221
|
+
t.float "annual_energy_from_propane_for_heating_water"
|
222
|
+
t.float "annual_energy_from_propane_for_appliances"
|
223
|
+
t.float "annual_energy_from_wood"
|
224
|
+
t.float "annual_energy_from_kerosene"
|
225
|
+
t.float "annual_energy_from_electricity_for_clothes_driers"
|
226
|
+
t.float "annual_energy_from_electricity_for_dishwashers"
|
227
|
+
t.float "annual_energy_from_electricity_for_freezers"
|
228
|
+
t.float "annual_energy_from_electricity_for_refrigerators"
|
229
|
+
t.float "annual_energy_from_electricity_for_air_conditioners"
|
230
|
+
t.float "annual_energy_from_electricity_for_heating_space"
|
231
|
+
t.float "annual_energy_from_electricity_for_heating_water"
|
232
|
+
t.float "annual_energy_from_electricity_for_other_appliances"
|
233
|
+
t.float "weighting"
|
234
|
+
t.float "lighting_use"
|
235
|
+
t.float "lighting_efficiency"
|
236
|
+
t.integer "heating_degree_days"
|
237
|
+
t.integer "cooling_degree_days"
|
238
|
+
t.integer "total_rooms"
|
239
|
+
t.integer "bathrooms"
|
240
|
+
t.integer "halfbaths"
|
241
|
+
t.integer "heated_garage"
|
242
|
+
t.integer "attached_1car_garage"
|
243
|
+
t.integer "detached_1car_garage"
|
244
|
+
t.integer "attached_2car_garage"
|
245
|
+
t.integer "detached_2car_garage"
|
246
|
+
t.integer "attached_3car_garage"
|
247
|
+
t.integer "detached_3car_garage"
|
248
|
+
t.integer "lights_on_1_to_4_hours"
|
249
|
+
t.integer "efficient_lights_on_1_to_4_hours"
|
250
|
+
t.integer "lights_on_4_to_12_hours"
|
251
|
+
t.integer "efficient_lights_on_4_to_12_hours"
|
252
|
+
t.integer "lights_on_over_12_hours"
|
253
|
+
t.integer "efficient_lights_on_over_12_hours"
|
254
|
+
t.integer "outdoor_all_night_lights"
|
255
|
+
t.integer "outdoor_all_night_gas_lights"
|
256
|
+
|
257
|
+
t.datetime "created_at"
|
258
|
+
t.datetime "updated_at"
|
259
|
+
end
|
260
|
+
execute "ALTER TABLE residential_energy_consumption_survey_responses ADD PRIMARY KEY (department_of_energy_identifier);"
|
261
|
+
|
262
|
+
create_table 'aircraft', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
263
|
+
t.string 'icao_code'
|
264
|
+
t.string 'manufacturer_name'
|
265
|
+
t.string 'name'
|
266
|
+
|
267
|
+
t.string "bts_name"
|
268
|
+
t.string "bts_aircraft_type_code"
|
269
|
+
|
270
|
+
t.string 'brighter_planet_aircraft_class_code'
|
271
|
+
# t.float 'm3'
|
272
|
+
# t.float 'm2'
|
273
|
+
# t.float 'm1'
|
274
|
+
# t.float 'endpoint_fuel'
|
275
|
+
t.datetime 'updated_at'
|
276
|
+
t.datetime 'created_at'
|
277
|
+
end
|
278
|
+
execute 'ALTER TABLE aircraft ADD PRIMARY KEY (icao_code);'
|
279
|
+
|
280
|
+
create_table 'aircraft_deux', :force => true, :options => 'ENGINE=InnoDB default charset=utf8', :id => false do |t|
|
281
|
+
t.string 'icao_code'
|
282
|
+
t.string 'manufacturer_name'
|
283
|
+
t.string 'name'
|
284
|
+
|
285
|
+
t.string "bts_name"
|
286
|
+
t.string "bts_aircraft_type_code"
|
287
|
+
|
288
|
+
# t.string 'brighter_planet_aircraft_class_code'
|
289
|
+
# t.float 'm3'
|
290
|
+
# t.float 'm2'
|
291
|
+
# t.float 'm1'
|
292
|
+
# t.float 'endpoint_fuel'
|
293
|
+
t.datetime 'updated_at'
|
294
|
+
t.datetime 'created_at'
|
295
|
+
end
|
296
|
+
execute 'ALTER TABLE aircraft_deux ADD PRIMARY KEY (icao_code);'
|
297
|
+
end
|
298
|
+
|
299
|
+
DataMiner::Run.create_tables
|
300
|
+
end
|
301
|
+
|
302
|
+
def load_models
|
303
|
+
load_schema
|
304
|
+
|
305
|
+
Dir.glob(File.expand_path('*.rb', File.dirname(__FILE__))).each do |lib|
|
306
|
+
require lib
|
307
|
+
end
|
308
|
+
end
|
309
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
$:.push File.dirname(__FILE__)
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestDataMinerProcess < Test::Unit::TestCase
|
5
|
+
context '#inspect' do
|
6
|
+
setup do
|
7
|
+
@config = DataMiner::Config.new 'foo'
|
8
|
+
end
|
9
|
+
should 'describe a block' do
|
10
|
+
process = DataMiner::Process.new(@config, 'something cool') { }
|
11
|
+
assert_match /block/, process.inspect
|
12
|
+
end
|
13
|
+
should 'describe a method' do
|
14
|
+
process = DataMiner::Process.new @config, :something_cool
|
15
|
+
assert_match /method/, process.inspect
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path('helper', File.dirname(__FILE__))
|
2
2
|
|
3
|
-
class
|
3
|
+
class TestDataMinerVerify < Test::Unit::TestCase
|
4
4
|
context '#run' do
|
5
5
|
should 'raise an exception if the verification block fails through exception' do
|
6
6
|
raising_check = lambda { raise "boom" }
|
data/test/test_old_syntax.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_miner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 23
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 1
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
8
|
+
- 3
|
9
|
+
version: 1.1.3
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Seamus Abshere
|
@@ -17,7 +16,7 @@ autorequire:
|
|
17
16
|
bindir: bin
|
18
17
|
cert_chain: []
|
19
18
|
|
20
|
-
date: 2011-01-28 00:00:00 -
|
19
|
+
date: 2011-01-28 00:00:00 -05:00
|
21
20
|
default_executable:
|
22
21
|
dependencies:
|
23
22
|
- !ruby/object:Gem::Dependency
|
@@ -28,7 +27,6 @@ dependencies:
|
|
28
27
|
requirements:
|
29
28
|
- - ">="
|
30
29
|
- !ruby/object:Gem::Version
|
31
|
-
hash: 19
|
32
30
|
segments:
|
33
31
|
- 1
|
34
32
|
- 1
|
@@ -44,7 +42,6 @@ dependencies:
|
|
44
42
|
requirements:
|
45
43
|
- - ">="
|
46
44
|
- !ruby/object:Gem::Version
|
47
|
-
hash: 23
|
48
45
|
segments:
|
49
46
|
- 0
|
50
47
|
- 0
|
@@ -60,7 +57,6 @@ dependencies:
|
|
60
57
|
requirements:
|
61
58
|
- - ">="
|
62
59
|
- !ruby/object:Gem::Version
|
63
|
-
hash: 11
|
64
60
|
segments:
|
65
61
|
- 2
|
66
62
|
- 3
|
@@ -76,7 +72,6 @@ dependencies:
|
|
76
72
|
requirements:
|
77
73
|
- - ">="
|
78
74
|
- !ruby/object:Gem::Version
|
79
|
-
hash: 11
|
80
75
|
segments:
|
81
76
|
- 2
|
82
77
|
- 3
|
@@ -92,7 +87,6 @@ dependencies:
|
|
92
87
|
requirements:
|
93
88
|
- - ">="
|
94
89
|
- !ruby/object:Gem::Version
|
95
|
-
hash: 15
|
96
90
|
segments:
|
97
91
|
- 1
|
98
92
|
- 4
|
@@ -108,7 +102,6 @@ dependencies:
|
|
108
102
|
requirements:
|
109
103
|
- - ">="
|
110
104
|
- !ruby/object:Gem::Version
|
111
|
-
hash: 23
|
112
105
|
segments:
|
113
106
|
- 0
|
114
107
|
- 3
|
@@ -124,7 +117,6 @@ dependencies:
|
|
124
117
|
requirements:
|
125
118
|
- - ">="
|
126
119
|
- !ruby/object:Gem::Version
|
127
|
-
hash: 5
|
128
120
|
segments:
|
129
121
|
- 0
|
130
122
|
- 3
|
@@ -140,7 +132,6 @@ dependencies:
|
|
140
132
|
requirements:
|
141
133
|
- - ">="
|
142
134
|
- !ruby/object:Gem::Version
|
143
|
-
hash: 21
|
144
135
|
segments:
|
145
136
|
- 1
|
146
137
|
- 0
|
@@ -156,7 +147,6 @@ dependencies:
|
|
156
147
|
requirements:
|
157
148
|
- - ">="
|
158
149
|
- !ruby/object:Gem::Version
|
159
|
-
hash: 21
|
160
150
|
segments:
|
161
151
|
- 0
|
162
152
|
- 0
|
@@ -172,7 +162,6 @@ dependencies:
|
|
172
162
|
requirements:
|
173
163
|
- - ">="
|
174
164
|
- !ruby/object:Gem::Version
|
175
|
-
hash: 3
|
176
165
|
segments:
|
177
166
|
- 0
|
178
167
|
version: "0"
|
@@ -186,7 +175,6 @@ dependencies:
|
|
186
175
|
requirements:
|
187
176
|
- - ">="
|
188
177
|
- !ruby/object:Gem::Version
|
189
|
-
hash: 3
|
190
178
|
segments:
|
191
179
|
- 0
|
192
180
|
version: "0"
|
@@ -200,21 +188,19 @@ dependencies:
|
|
200
188
|
requirements:
|
201
189
|
- - ">="
|
202
190
|
- !ruby/object:Gem::Version
|
203
|
-
hash: 3
|
204
191
|
segments:
|
205
192
|
- 0
|
206
193
|
version: "0"
|
207
194
|
type: :development
|
208
195
|
version_requirements: *id012
|
209
196
|
- !ruby/object:Gem::Dependency
|
210
|
-
name: ruby-
|
197
|
+
name: ruby-debug19
|
211
198
|
prerelease: false
|
212
199
|
requirement: &id013 !ruby/object:Gem::Requirement
|
213
200
|
none: false
|
214
201
|
requirements:
|
215
202
|
- - ">="
|
216
203
|
- !ruby/object:Gem::Version
|
217
|
-
hash: 3
|
218
204
|
segments:
|
219
205
|
- 0
|
220
206
|
version: "0"
|
@@ -256,9 +242,11 @@ files:
|
|
256
242
|
- test/support/automobile_fuel_type.rb
|
257
243
|
- test/support/automobile_variant.rb
|
258
244
|
- test/support/country.rb
|
259
|
-
- test/
|
245
|
+
- test/support/test_database.rb
|
246
|
+
- test/test_data_miner_attribute.rb
|
247
|
+
- test/test_data_miner_process.rb
|
248
|
+
- test/test_data_miner_verify.rb
|
260
249
|
- test/test_old_syntax.rb
|
261
|
-
- test/test_verify.rb
|
262
250
|
has_rdoc: true
|
263
251
|
homepage: https://github.com/seamusabshere/data_miner
|
264
252
|
licenses: []
|
@@ -273,7 +261,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
273
261
|
requirements:
|
274
262
|
- - ">="
|
275
263
|
- !ruby/object:Gem::Version
|
276
|
-
hash: 3
|
277
264
|
segments:
|
278
265
|
- 0
|
279
266
|
version: "0"
|
@@ -282,7 +269,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
269
|
requirements:
|
283
270
|
- - ">="
|
284
271
|
- !ruby/object:Gem::Version
|
285
|
-
hash: 3
|
286
272
|
segments:
|
287
273
|
- 0
|
288
274
|
version: "0"
|
@@ -293,13 +279,5 @@ rubygems_version: 1.3.7
|
|
293
279
|
signing_key:
|
294
280
|
specification_version: 3
|
295
281
|
summary: Mine remote data into your ActiveRecord models.
|
296
|
-
test_files:
|
297
|
-
|
298
|
-
- test/support/aircraft.rb
|
299
|
-
- test/support/airport.rb
|
300
|
-
- test/support/automobile_fuel_type.rb
|
301
|
-
- test/support/automobile_variant.rb
|
302
|
-
- test/support/country.rb
|
303
|
-
- test/test_attribute.rb
|
304
|
-
- test/test_old_syntax.rb
|
305
|
-
- test/test_verify.rb
|
282
|
+
test_files: []
|
283
|
+
|