sniff 0.4.4 → 0.4.5

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.
@@ -114,14 +114,16 @@ module Sniff
114
114
 
115
115
  def populate_fixtures
116
116
  Encoding.default_external = 'UTF-8'
117
- fixtures.each do |fixture_file|
118
- klass = File.basename(fixture_file, '.csv').
119
- camelize.singularize
120
- pluralized_klass = klass.pluralize
117
+ Earth.resource_names.each do |klass|
121
118
  klass = klass.pluralize unless Object.const_defined?(klass)
122
119
  if Object.const_defined?(klass) and klass.constantize.table_exists?
123
- log "Loading fixture #{fixture_file}"
124
- Fixtures.create_fixtures(fixtures_path, fixture_file[(fixtures_path.size + 1)..-5])
120
+ object = klass.constantize
121
+ table_name = object.table_name
122
+ fixture_file = File.join(fixtures_path, table_name + '.csv')
123
+ if File.exist? fixture_file
124
+ log "Loading fixture #{fixture_file}"
125
+ Fixtures.create_fixtures(fixtures_path, table_name, klass => table_name)
126
+ end
125
127
  end
126
128
  end
127
129
  end
@@ -25,6 +25,10 @@ describe Sniff::Database do
25
25
  require File.join(dirigible_path, 'lib', 'test_support', 'dirigible_record')
26
26
  DirigibleRecord.table_exists?.should be_true
27
27
  end
28
+ it 'should load data for PADD' do
29
+ Sniff.init(dirigible_path, :earth => :locality, :apply_schemas => true)
30
+ PetroleumAdministrationForDefenseDistrict.all.count.should == 7
31
+ end
28
32
  end
29
33
  end
30
34
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 4
9
- version: 0.4.4
8
+ - 5
9
+ version: 0.4.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Derek Kastner
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-14 00:00:00 -05:00
17
+ date: 2010-12-15 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -296,7 +296,7 @@ files:
296
296
  - lib/test_support/db/fixtures/egrid_regions.csv
297
297
  - lib/test_support/db/fixtures/egrid_subregions.csv
298
298
  - lib/test_support/db/fixtures/genders.csv
299
- - lib/test_support/db/fixtures/petrolem_districts.csv
299
+ - lib/test_support/db/fixtures/petroleum_districts.csv
300
300
  - lib/test_support/db/fixtures/states.csv
301
301
  - lib/test_support/db/fixtures/urbanities.csv
302
302
  - lib/test_support/db/fixtures/zip_codes.csv
@@ -325,7 +325,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
325
325
  requirements:
326
326
  - - ">="
327
327
  - !ruby/object:Gem::Version
328
- hash: -7791839
328
+ hash: 185196851
329
329
  segments:
330
330
  - 0
331
331
  version: "0"