sniff 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/README.markdown +73 -0
  2. data/lib/sniff/active_record_ext.rb +12 -0
  3. data/lib/sniff/conversions_ext.rb +45 -0
  4. data/lib/sniff/database.rb +157 -0
  5. data/lib/sniff/emitter.rb +65 -0
  6. data/lib/sniff/tasks.rb +14 -0
  7. data/lib/sniff/timeframe.rb +251 -0
  8. data/lib/sniff.rb +31 -0
  9. data/lib/test_support/data_models/census_division.rb +9 -0
  10. data/lib/test_support/data_models/census_region.rb +9 -0
  11. data/lib/test_support/data_models/climate_division.rb +8 -0
  12. data/lib/test_support/data_models/country.rb +9 -0
  13. data/lib/test_support/data_models/egrid_region.rb +7 -0
  14. data/lib/test_support/data_models/egrid_subregion.rb +8 -0
  15. data/lib/test_support/data_models/gender.rb +6 -0
  16. data/lib/test_support/data_models/petroleum_administration_for_defense_district.rb +9 -0
  17. data/lib/test_support/data_models/state.rb +13 -0
  18. data/lib/test_support/data_models/urbanity.rb +6 -0
  19. data/lib/test_support/data_models/zip_code.rb +14 -0
  20. data/lib/test_support/db/fixtures/census_divisions.csv +10 -0
  21. data/lib/test_support/db/fixtures/census_regions.csv +5 -0
  22. data/lib/test_support/db/fixtures/climate_divisions.csv +360 -0
  23. data/lib/test_support/db/fixtures/countries.csv +247 -0
  24. data/lib/test_support/db/fixtures/egrid_regions.csv +6 -0
  25. data/lib/test_support/db/fixtures/egrid_subregions.csv +27 -0
  26. data/lib/test_support/db/fixtures/genders.csv +3 -0
  27. data/lib/test_support/db/fixtures/petroleum_administration_for_defense_districts.csv +8 -0
  28. data/lib/test_support/db/fixtures/states.csv +58 -0
  29. data/lib/test_support/db/fixtures/urbanities.csv +5 -0
  30. data/lib/test_support/db/fixtures/yearly_anonymous_emissions.csv +0 -0
  31. data/lib/test_support/db/fixtures/yearly_typical_emissions.csv +0 -0
  32. data/lib/test_support/db/fixtures/zip_codes.csv +3390 -0
  33. data/lib/test_support/db/schema.rb +117 -0
  34. data/spec/lib/sniff/database_spec.rb +22 -0
  35. data/spec/spec.opts +2 -0
  36. data/spec/spec_helper.rb +5 -0
  37. data/vendor/geokit-rails/CHANGELOG.rdoc +46 -0
  38. data/vendor/geokit-rails/MIT-LICENSE +20 -0
  39. data/vendor/geokit-rails/README.markdown +561 -0
  40. data/vendor/geokit-rails/Rakefile +18 -0
  41. data/vendor/geokit-rails/about.yml +9 -0
  42. data/vendor/geokit-rails/assets/api_keys_template +61 -0
  43. data/vendor/geokit-rails/init.rb +1 -0
  44. data/vendor/geokit-rails/install.rb +14 -0
  45. data/vendor/geokit-rails/lib/geokit-rails/acts_as_mappable.rb +456 -0
  46. data/vendor/geokit-rails/lib/geokit-rails/adapters/abstract.rb +31 -0
  47. data/vendor/geokit-rails/lib/geokit-rails/adapters/mysql.rb +22 -0
  48. data/vendor/geokit-rails/lib/geokit-rails/adapters/postgresql.rb +22 -0
  49. data/vendor/geokit-rails/lib/geokit-rails/adapters/sqlserver.rb +43 -0
  50. data/vendor/geokit-rails/lib/geokit-rails/defaults.rb +22 -0
  51. data/vendor/geokit-rails/lib/geokit-rails/geocoder_control.rb +16 -0
  52. data/vendor/geokit-rails/lib/geokit-rails/ip_geocode_lookup.rb +46 -0
  53. data/vendor/geokit-rails/lib/geokit-rails.rb +24 -0
  54. data/vendor/geokit-rails/test/acts_as_mappable_test.rb +474 -0
  55. data/vendor/geokit-rails/test/boot.rb +25 -0
  56. data/vendor/geokit-rails/test/database.yml +20 -0
  57. data/vendor/geokit-rails/test/fixtures/companies.yml +7 -0
  58. data/vendor/geokit-rails/test/fixtures/custom_locations.yml +54 -0
  59. data/vendor/geokit-rails/test/fixtures/locations.yml +54 -0
  60. data/vendor/geokit-rails/test/fixtures/mock_addresses.yml +17 -0
  61. data/vendor/geokit-rails/test/fixtures/mock_families.yml +2 -0
  62. data/vendor/geokit-rails/test/fixtures/mock_houses.yml +9 -0
  63. data/vendor/geokit-rails/test/fixtures/mock_organizations.yml +5 -0
  64. data/vendor/geokit-rails/test/fixtures/mock_people.yml +5 -0
  65. data/vendor/geokit-rails/test/fixtures/stores.yml +0 -0
  66. data/vendor/geokit-rails/test/ip_geocode_lookup_test.rb +77 -0
  67. data/vendor/geokit-rails/test/models/company.rb +3 -0
  68. data/vendor/geokit-rails/test/models/custom_location.rb +12 -0
  69. data/vendor/geokit-rails/test/models/location.rb +4 -0
  70. data/vendor/geokit-rails/test/models/mock_address.rb +4 -0
  71. data/vendor/geokit-rails/test/models/mock_family.rb +3 -0
  72. data/vendor/geokit-rails/test/models/mock_house.rb +3 -0
  73. data/vendor/geokit-rails/test/models/mock_organization.rb +4 -0
  74. data/vendor/geokit-rails/test/models/mock_person.rb +4 -0
  75. data/vendor/geokit-rails/test/models/store.rb +3 -0
  76. data/vendor/geokit-rails/test/schema.rb +60 -0
  77. data/vendor/geokit-rails/test/tasks.rake +31 -0
  78. data/vendor/geokit-rails/test/test_helper.rb +23 -0
  79. metadata +492 -0
metadata ADDED
@@ -0,0 +1,492 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sniff
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 2
10
+ version: 0.0.2
11
+ platform: ruby
12
+ authors:
13
+ - Derek Kastner
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-07-13 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ type: :runtime
23
+ prerelease: false
24
+ name: activerecord
25
+ version_requirements: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - "="
29
+ - !ruby/object:Gem::Version
30
+ hash: -1848230024
31
+ segments:
32
+ - 3
33
+ - 0
34
+ - 0
35
+ - beta4
36
+ version: 3.0.0.beta4
37
+ requirement: *id001
38
+ - !ruby/object:Gem::Dependency
39
+ type: :runtime
40
+ prerelease: false
41
+ name: sqlite3-ruby
42
+ version_requirements: &id002 !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - "="
46
+ - !ruby/object:Gem::Version
47
+ hash: 27
48
+ segments:
49
+ - 1
50
+ - 3
51
+ - 0
52
+ version: 1.3.0
53
+ requirement: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ type: :runtime
56
+ prerelease: false
57
+ name: falls_back_on
58
+ version_requirements: &id003 !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - "="
62
+ - !ruby/object:Gem::Version
63
+ hash: 27
64
+ segments:
65
+ - 0
66
+ - 0
67
+ - 2
68
+ version: 0.0.2
69
+ requirement: *id003
70
+ - !ruby/object:Gem::Dependency
71
+ type: :runtime
72
+ prerelease: false
73
+ name: cohort_scope
74
+ version_requirements: &id004 !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - "="
78
+ - !ruby/object:Gem::Version
79
+ hash: 21
80
+ segments:
81
+ - 0
82
+ - 0
83
+ - 5
84
+ version: 0.0.5
85
+ requirement: *id004
86
+ - !ruby/object:Gem::Dependency
87
+ type: :runtime
88
+ prerelease: false
89
+ name: leap
90
+ version_requirements: &id005 !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - "="
94
+ - !ruby/object:Gem::Version
95
+ hash: 21
96
+ segments:
97
+ - 0
98
+ - 3
99
+ - 3
100
+ version: 0.3.3
101
+ requirement: *id005
102
+ - !ruby/object:Gem::Dependency
103
+ type: :runtime
104
+ prerelease: false
105
+ name: summary_judgement
106
+ version_requirements: &id006 !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - "="
110
+ - !ruby/object:Gem::Version
111
+ hash: 11
112
+ segments:
113
+ - 1
114
+ - 3
115
+ - 8
116
+ version: 1.3.8
117
+ requirement: *id006
118
+ - !ruby/object:Gem::Dependency
119
+ type: :runtime
120
+ prerelease: false
121
+ name: fast_timestamp
122
+ version_requirements: &id007 !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - "="
126
+ - !ruby/object:Gem::Version
127
+ hash: 23
128
+ segments:
129
+ - 0
130
+ - 0
131
+ - 4
132
+ version: 0.0.4
133
+ requirement: *id007
134
+ - !ruby/object:Gem::Dependency
135
+ type: :runtime
136
+ prerelease: false
137
+ name: common_name
138
+ version_requirements: &id008 !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - "="
142
+ - !ruby/object:Gem::Version
143
+ hash: 17
144
+ segments:
145
+ - 0
146
+ - 1
147
+ - 5
148
+ version: 0.1.5
149
+ requirement: *id008
150
+ - !ruby/object:Gem::Dependency
151
+ type: :runtime
152
+ prerelease: false
153
+ name: conversions
154
+ version_requirements: &id009 !ruby/object:Gem::Requirement
155
+ none: false
156
+ requirements:
157
+ - - "="
158
+ - !ruby/object:Gem::Version
159
+ hash: 13
160
+ segments:
161
+ - 1
162
+ - 4
163
+ - 5
164
+ version: 1.4.5
165
+ requirement: *id009
166
+ - !ruby/object:Gem::Dependency
167
+ type: :runtime
168
+ prerelease: false
169
+ name: geokit
170
+ version_requirements: &id010 !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - "="
174
+ - !ruby/object:Gem::Version
175
+ hash: 3
176
+ segments:
177
+ - 1
178
+ - 5
179
+ - 0
180
+ version: 1.5.0
181
+ requirement: *id010
182
+ - !ruby/object:Gem::Dependency
183
+ type: :runtime
184
+ prerelease: false
185
+ name: data_miner
186
+ version_requirements: &id011 !ruby/object:Gem::Requirement
187
+ none: false
188
+ requirements:
189
+ - - "="
190
+ - !ruby/object:Gem::Version
191
+ hash: 87
192
+ segments:
193
+ - 0
194
+ - 4
195
+ - 44
196
+ version: 0.4.44
197
+ requirement: *id011
198
+ - !ruby/object:Gem::Dependency
199
+ type: :development
200
+ prerelease: false
201
+ name: bundler
202
+ version_requirements: &id012 !ruby/object:Gem::Requirement
203
+ none: false
204
+ requirements:
205
+ - - ">="
206
+ - !ruby/object:Gem::Version
207
+ hash: 3
208
+ segments:
209
+ - 0
210
+ version: "0"
211
+ requirement: *id012
212
+ - !ruby/object:Gem::Dependency
213
+ type: :development
214
+ prerelease: false
215
+ name: jeweler
216
+ version_requirements: &id013 !ruby/object:Gem::Requirement
217
+ none: false
218
+ requirements:
219
+ - - ">="
220
+ - !ruby/object:Gem::Version
221
+ hash: 3
222
+ segments:
223
+ - 0
224
+ version: "0"
225
+ requirement: *id013
226
+ - !ruby/object:Gem::Dependency
227
+ type: :development
228
+ prerelease: false
229
+ name: rake
230
+ version_requirements: &id014 !ruby/object:Gem::Requirement
231
+ none: false
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ hash: 3
236
+ segments:
237
+ - 0
238
+ version: "0"
239
+ requirement: *id014
240
+ - !ruby/object:Gem::Dependency
241
+ type: :development
242
+ prerelease: false
243
+ name: rspec
244
+ version_requirements: &id015 !ruby/object:Gem::Requirement
245
+ none: false
246
+ requirements:
247
+ - - ">="
248
+ - !ruby/object:Gem::Version
249
+ hash: 3
250
+ segments:
251
+ - 0
252
+ version: "0"
253
+ requirement: *id015
254
+ - !ruby/object:Gem::Dependency
255
+ type: :development
256
+ prerelease: false
257
+ name: rcov
258
+ version_requirements: &id016 !ruby/object:Gem::Requirement
259
+ none: false
260
+ requirements:
261
+ - - ">="
262
+ - !ruby/object:Gem::Version
263
+ hash: 3
264
+ segments:
265
+ - 0
266
+ version: "0"
267
+ requirement: *id016
268
+ - !ruby/object:Gem::Dependency
269
+ type: :development
270
+ prerelease: false
271
+ name: rdoc
272
+ version_requirements: &id017 !ruby/object:Gem::Requirement
273
+ none: false
274
+ requirements:
275
+ - - ">="
276
+ - !ruby/object:Gem::Version
277
+ hash: 3
278
+ segments:
279
+ - 0
280
+ version: "0"
281
+ requirement: *id017
282
+ description: |
283
+ # sniff
284
+ Testing environment for Brighter Planet Climate Middleware emission calculation gems.
285
+
286
+ This gem provides:
287
+ * Sample climate data, representative of data found on http://data.brighterplanet.com
288
+ * References to gems needed by each emitter gem
289
+
290
+ # Usage
291
+ Within an emitter gem's test setup, you can:
292
+ require 'sniff'
293
+
294
+ Sniff.init '/path/to/emitter_project'
295
+
296
+ # How to contribute
297
+ Typical contributions will include updates to test data.
298
+
299
+ 1. Fork the project.
300
+ 1. Make your feature addition or bug fix.
301
+ 1. Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
302
+ 1. Send me a pull request. Bonus points for topic branches.
303
+
304
+ # Local Gems
305
+ Sniff depends on several gems, some of which are developed by Brighter Planet. You can tell Sniff or any of the carbon gems to use your local repos in lieu of installed rubygems through the following steps:
306
+
307
+
308
+ Paste the following functions into your ~/.bash_profile
309
+ function mod_devgem() {
310
+ var="LOCAL_`echo $2 | tr 'a-z' 'A-Z'`"
311
+
312
+ if [ "$1" == "disable" ]
313
+ then
314
+ echo "unset $var"
315
+ unset $var
316
+ else
317
+ dir=${3:-"~/$2"}
318
+ echo "export $var=$dir"
319
+ export $var=$dir
320
+ fi
321
+ }
322
+
323
+ function devgems () {
324
+ # Usage: devgems [enable|disable] [gemname]
325
+ cmd=${1:-"enable"}
326
+ if [ -z $2 ]
327
+ then
328
+ mod_devgem $cmd characterizable
329
+ mod_devgem $cmd cohort_scope
330
+ mod_devgem $cmd falls_back_on
331
+ mod_devgem $cmd leap
332
+ mod_devgem $cmd loose_tight_dictionary
333
+ mod_devgem $cmd sniff
334
+ mod_devgem $cmd data_miner
335
+ else
336
+ mod_devgem $cmd $2
337
+ fi
338
+ }
339
+
340
+ To enable all local gems, run `devgems enable`
341
+ To turn off devgems, run `devgems disable`
342
+ To turn off a specific gem, run `devgems disable leap`
343
+ To turn on a specific gem, run `devgems enable leap`
344
+
345
+ Typical development process:
346
+ cd ~
347
+ git clone http://github.com/rossmeissl/leap.git
348
+ cd leap
349
+ <do some development on leap>
350
+ cd ~/sniff
351
+ devgems enable leap
352
+ rake gemspec
353
+ rm -f Gemfile.lock
354
+ bundle install
355
+ <run tests, e.g. `spec spec`>
356
+
357
+ email: derek.kastner@brighterplanet.com
358
+ executables: []
359
+
360
+ extensions: []
361
+
362
+ extra_rdoc_files:
363
+ - README.markdown
364
+ files:
365
+ - lib/sniff.rb
366
+ - lib/sniff/active_record_ext.rb
367
+ - lib/sniff/conversions_ext.rb
368
+ - lib/sniff/database.rb
369
+ - lib/sniff/emitter.rb
370
+ - lib/sniff/tasks.rb
371
+ - lib/sniff/timeframe.rb
372
+ - lib/test_support/data_models/census_division.rb
373
+ - lib/test_support/data_models/census_region.rb
374
+ - lib/test_support/data_models/climate_division.rb
375
+ - lib/test_support/data_models/country.rb
376
+ - lib/test_support/data_models/egrid_region.rb
377
+ - lib/test_support/data_models/egrid_subregion.rb
378
+ - lib/test_support/data_models/gender.rb
379
+ - lib/test_support/data_models/petroleum_administration_for_defense_district.rb
380
+ - lib/test_support/data_models/state.rb
381
+ - lib/test_support/data_models/urbanity.rb
382
+ - lib/test_support/data_models/zip_code.rb
383
+ - lib/test_support/db/fixtures/census_divisions.csv
384
+ - lib/test_support/db/fixtures/census_regions.csv
385
+ - lib/test_support/db/fixtures/climate_divisions.csv
386
+ - lib/test_support/db/fixtures/countries.csv
387
+ - lib/test_support/db/fixtures/egrid_regions.csv
388
+ - lib/test_support/db/fixtures/egrid_subregions.csv
389
+ - lib/test_support/db/fixtures/genders.csv
390
+ - lib/test_support/db/fixtures/petroleum_administration_for_defense_districts.csv
391
+ - lib/test_support/db/fixtures/states.csv
392
+ - lib/test_support/db/fixtures/urbanities.csv
393
+ - lib/test_support/db/fixtures/yearly_anonymous_emissions.csv
394
+ - lib/test_support/db/fixtures/yearly_typical_emissions.csv
395
+ - lib/test_support/db/fixtures/zip_codes.csv
396
+ - lib/test_support/db/schema.rb
397
+ - vendor/geokit-rails/CHANGELOG.rdoc
398
+ - vendor/geokit-rails/MIT-LICENSE
399
+ - vendor/geokit-rails/README.markdown
400
+ - vendor/geokit-rails/Rakefile
401
+ - vendor/geokit-rails/about.yml
402
+ - vendor/geokit-rails/assets/api_keys_template
403
+ - vendor/geokit-rails/init.rb
404
+ - vendor/geokit-rails/install.rb
405
+ - vendor/geokit-rails/lib/geokit-rails.rb
406
+ - vendor/geokit-rails/lib/geokit-rails/acts_as_mappable.rb
407
+ - vendor/geokit-rails/lib/geokit-rails/adapters/abstract.rb
408
+ - vendor/geokit-rails/lib/geokit-rails/adapters/mysql.rb
409
+ - vendor/geokit-rails/lib/geokit-rails/adapters/postgresql.rb
410
+ - vendor/geokit-rails/lib/geokit-rails/adapters/sqlserver.rb
411
+ - vendor/geokit-rails/lib/geokit-rails/defaults.rb
412
+ - vendor/geokit-rails/lib/geokit-rails/geocoder_control.rb
413
+ - vendor/geokit-rails/lib/geokit-rails/ip_geocode_lookup.rb
414
+ - vendor/geokit-rails/test/acts_as_mappable_test.rb
415
+ - vendor/geokit-rails/test/boot.rb
416
+ - vendor/geokit-rails/test/database.yml
417
+ - vendor/geokit-rails/test/fixtures/companies.yml
418
+ - vendor/geokit-rails/test/fixtures/custom_locations.yml
419
+ - vendor/geokit-rails/test/fixtures/locations.yml
420
+ - vendor/geokit-rails/test/fixtures/mock_addresses.yml
421
+ - vendor/geokit-rails/test/fixtures/mock_families.yml
422
+ - vendor/geokit-rails/test/fixtures/mock_houses.yml
423
+ - vendor/geokit-rails/test/fixtures/mock_organizations.yml
424
+ - vendor/geokit-rails/test/fixtures/mock_people.yml
425
+ - vendor/geokit-rails/test/fixtures/stores.yml
426
+ - vendor/geokit-rails/test/ip_geocode_lookup_test.rb
427
+ - vendor/geokit-rails/test/models/company.rb
428
+ - vendor/geokit-rails/test/models/custom_location.rb
429
+ - vendor/geokit-rails/test/models/location.rb
430
+ - vendor/geokit-rails/test/models/mock_address.rb
431
+ - vendor/geokit-rails/test/models/mock_family.rb
432
+ - vendor/geokit-rails/test/models/mock_house.rb
433
+ - vendor/geokit-rails/test/models/mock_organization.rb
434
+ - vendor/geokit-rails/test/models/mock_person.rb
435
+ - vendor/geokit-rails/test/models/store.rb
436
+ - vendor/geokit-rails/test/schema.rb
437
+ - vendor/geokit-rails/test/tasks.rake
438
+ - vendor/geokit-rails/test/test_helper.rb
439
+ - README.markdown
440
+ - spec/lib/sniff/database_spec.rb
441
+ - spec/spec_helper.rb
442
+ - spec/spec.opts
443
+ has_rdoc: true
444
+ homepage: http://github.com/brighterplanet/sniff
445
+ licenses: []
446
+
447
+ post_install_message:
448
+ rdoc_options:
449
+ - --charset=UTF-8
450
+ require_paths:
451
+ - lib
452
+ required_ruby_version: !ruby/object:Gem::Requirement
453
+ none: false
454
+ requirements:
455
+ - - ">="
456
+ - !ruby/object:Gem::Version
457
+ hash: 3
458
+ segments:
459
+ - 0
460
+ version: "0"
461
+ required_rubygems_version: !ruby/object:Gem::Requirement
462
+ none: false
463
+ requirements:
464
+ - - ">="
465
+ - !ruby/object:Gem::Version
466
+ hash: 3
467
+ segments:
468
+ - 0
469
+ version: "0"
470
+ requirements: []
471
+
472
+ rubyforge_project:
473
+ rubygems_version: 1.3.7
474
+ signing_key:
475
+ specification_version: 3
476
+ summary: Test support for Brighter Planet carbon gems
477
+ test_files:
478
+ - spec/lib/sniff/database_spec.rb
479
+ - spec/spec_helper.rb
480
+ - lib/test_support/data_models/census_division.rb
481
+ - lib/test_support/data_models/census_region.rb
482
+ - lib/test_support/data_models/climate_division.rb
483
+ - lib/test_support/data_models/country.rb
484
+ - lib/test_support/data_models/egrid_region.rb
485
+ - lib/test_support/data_models/egrid_subregion.rb
486
+ - lib/test_support/data_models/gender.rb
487
+ - lib/test_support/data_models/petroleum_administration_for_defense_district.rb
488
+ - lib/test_support/data_models/state.rb
489
+ - lib/test_support/data_models/urbanity.rb
490
+ - lib/test_support/data_models/zip_code.rb
491
+ - lib/test_support/db/schema.rb
492
+ - spec/spec.opts