earth 0.0.30 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +25 -25
- data/lib/earth.rb +4 -2
- data/lib/earth/base.rb +7 -0
- data/lib/earth/industry/data_miner.rb +6 -0
- data/lib/earth/industry/industries_product_lines.rb +7 -3
- data/lib/earth/industry/industries_product_lines/data_miner.rb +13 -0
- data/lib/earth/industry/industries_sectors.rb +7 -6
- data/lib/earth/industry/industries_sectors/data_miner.rb +12 -0
- data/lib/earth/industry/merchant.rb +7 -3
- data/lib/earth/industry/merchant/data_miner.rb +12 -0
- data/lib/earth/industry/merchant_categories_industries.rb +7 -4
- data/lib/earth/industry/merchant_categories_industries/data_miner.rb +12 -0
- data/lib/earth/industry/merchant_category/data_miner.rb +11 -0
- data/lib/earth/industry/product_lines_sectors.rb +7 -5
- data/lib/earth/industry/product_lines_sectors/data_miner.rb +14 -0
- data/lib/earth/industry/sector.rb +9 -3
- data/lib/earth/industry/sector/data_miner.rb +13 -0
- data/spec/lib/earth/industry/industries_product_lines_spec.rb +17 -0
- data/spec/lib/earth/industry/industries_sectors_spec.rb +17 -0
- data/spec/lib/earth/industry/industry_spec.rb +17 -0
- data/spec/lib/earth/industry/merchant_categories_industries_spec.rb +16 -0
- data/spec/lib/earth/industry/merchant_category_spec.rb +15 -0
- data/spec/lib/earth/industry/merchant_spec.rb +17 -0
- data/spec/lib/earth/industry/product_line_spec.rb +17 -0
- data/spec/lib/earth/industry/product_lines_sectors_spec.rb +17 -0
- data/spec/lib/earth/industry/sector_spec.rb +13 -0
- data/spec/lib/industries_sectors_spec.rb +17 -0
- metadata +31 -5
data/Gemfile.lock
CHANGED
@@ -4,27 +4,27 @@ GEM
|
|
4
4
|
GData (0.0.4)
|
5
5
|
builder (>= 2.1.2)
|
6
6
|
hoe (>= 1.2.1)
|
7
|
-
activemodel (3.0.0
|
8
|
-
activesupport (= 3.0.0
|
7
|
+
activemodel (3.0.0)
|
8
|
+
activesupport (= 3.0.0)
|
9
9
|
builder (~> 2.1.2)
|
10
10
|
i18n (~> 0.4.1)
|
11
|
-
activerecord (3.0.0
|
12
|
-
activemodel (= 3.0.0
|
13
|
-
activesupport (= 3.0.0
|
14
|
-
arel (~> 0.
|
15
|
-
tzinfo (~> 0.3.
|
16
|
-
activesupport (3.0.0
|
11
|
+
activerecord (3.0.0)
|
12
|
+
activemodel (= 3.0.0)
|
13
|
+
activesupport (= 3.0.0)
|
14
|
+
arel (~> 1.0.0)
|
15
|
+
tzinfo (~> 0.3.23)
|
16
|
+
activesupport (3.0.0)
|
17
17
|
andand (1.3.1)
|
18
|
-
arel (0.
|
19
|
-
activesupport (
|
18
|
+
arel (1.0.1)
|
19
|
+
activesupport (~> 3.0.0)
|
20
20
|
blockenspiel (0.3.2)
|
21
21
|
builder (2.1.2)
|
22
|
-
cohort_scope (0.0.
|
22
|
+
cohort_scope (0.0.7)
|
23
23
|
activerecord (>= 3.0.0.beta4)
|
24
24
|
activesupport (>= 3.0.0.beta4)
|
25
25
|
conversions (1.4.5)
|
26
26
|
activesupport (>= 2.3.4)
|
27
|
-
data_miner (0.5.
|
27
|
+
data_miner (0.5.3)
|
28
28
|
activerecord (>= 2.3.4)
|
29
29
|
activesupport (>= 2.3.4)
|
30
30
|
andand (>= 1.3.1)
|
@@ -40,13 +40,13 @@ GEM
|
|
40
40
|
activesupport (>= 2.3.4)
|
41
41
|
remote_table (>= 0.2.20)
|
42
42
|
escape (0.0.4)
|
43
|
-
falls_back_on (0.0.
|
43
|
+
falls_back_on (0.0.3)
|
44
44
|
activerecord
|
45
45
|
fastercsv (1.5.3)
|
46
46
|
gemcutter (0.6.1)
|
47
47
|
geokit (1.5.0)
|
48
48
|
git (1.2.5)
|
49
|
-
hoe (2.6.
|
49
|
+
hoe (2.6.2)
|
50
50
|
rake (>= 0.8.7)
|
51
51
|
rubyforge (>= 2.0.4)
|
52
52
|
hpricot (0.8.2)
|
@@ -55,7 +55,7 @@ GEM
|
|
55
55
|
gemcutter (>= 0.1.0)
|
56
56
|
git (>= 1.2.5)
|
57
57
|
rubyforge (>= 2.0.0)
|
58
|
-
json_pure (1.4.
|
58
|
+
json_pure (1.4.6)
|
59
59
|
libxml-ruby (1.1.4)
|
60
60
|
log4r (1.1.8)
|
61
61
|
mime-types (1.16)
|
@@ -63,7 +63,7 @@ GEM
|
|
63
63
|
rack (1.2.1)
|
64
64
|
rake (0.8.7)
|
65
65
|
rcov (0.9.8)
|
66
|
-
rdoc (2.5.
|
66
|
+
rdoc (2.5.11)
|
67
67
|
remote_table (0.2.27)
|
68
68
|
activesupport (>= 2.3.4)
|
69
69
|
escape (>= 0.0.4)
|
@@ -79,14 +79,14 @@ GEM
|
|
79
79
|
libxml-ruby (>= 1.1.3)
|
80
80
|
rubyzip (>= 0.9.1)
|
81
81
|
spreadsheet (>= 0.6.4)
|
82
|
-
rspec (2.0.0.beta.
|
83
|
-
rspec-core (= 2.0.0.beta.
|
84
|
-
rspec-expectations (= 2.0.0.beta.
|
85
|
-
rspec-mocks (= 2.0.0.beta.
|
86
|
-
rspec-core (2.0.0.beta.
|
87
|
-
rspec-expectations (2.0.0.beta.
|
82
|
+
rspec (2.0.0.beta.20)
|
83
|
+
rspec-core (= 2.0.0.beta.20)
|
84
|
+
rspec-expectations (= 2.0.0.beta.20)
|
85
|
+
rspec-mocks (= 2.0.0.beta.20)
|
86
|
+
rspec-core (2.0.0.beta.20)
|
87
|
+
rspec-expectations (2.0.0.beta.20)
|
88
88
|
diff-lcs (>= 1.1.2)
|
89
|
-
rspec-mocks (2.0.0.beta.
|
89
|
+
rspec-mocks (2.0.0.beta.20)
|
90
90
|
ruby-ole (1.2.10.1)
|
91
91
|
rubyforge (2.0.4)
|
92
92
|
json_pure (>= 1.1.7)
|
@@ -97,7 +97,7 @@ GEM
|
|
97
97
|
slither (0.99.3)
|
98
98
|
spreadsheet (0.6.4.1)
|
99
99
|
ruby-ole
|
100
|
-
sqlite3-ruby (1.3.
|
100
|
+
sqlite3-ruby (1.3.1)
|
101
101
|
taps (0.3.11)
|
102
102
|
json_pure (>= 1.2.0, < 1.5.0)
|
103
103
|
rack (>= 1.0.1)
|
@@ -105,7 +105,7 @@ GEM
|
|
105
105
|
sequel (~> 3.13.0)
|
106
106
|
sinatra (~> 1.0.0)
|
107
107
|
sqlite3-ruby (~> 1.2)
|
108
|
-
tzinfo (0.3.
|
108
|
+
tzinfo (0.3.23)
|
109
109
|
|
110
110
|
PLATFORMS
|
111
111
|
ruby
|
data/lib/earth.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'active_record'
|
2
2
|
require 'cohort_scope'
|
3
|
+
require 'earth/base'
|
3
4
|
require 'earth/conversions_ext'
|
4
5
|
require 'earth/inflectors'
|
5
6
|
require 'data_miner'
|
@@ -152,9 +153,10 @@ private
|
|
152
153
|
|
153
154
|
def load_data_miner_schemas
|
154
155
|
models = Module.constants.select do |k|
|
155
|
-
const = Object.const_get(k)
|
156
|
+
const = Object.const_get(k) if Object.const_defined?(k)
|
156
157
|
if const.instance_of?(Class)
|
157
|
-
const.superclass == ActiveRecord::Base
|
158
|
+
const.superclass == ActiveRecord::Base ||
|
159
|
+
const.superclass == Earth::Base
|
158
160
|
else
|
159
161
|
false
|
160
162
|
end
|
data/lib/earth/base.rb
ADDED
@@ -1,2 +1,8 @@
|
|
1
|
+
require 'earth/industry/industries_product_lines/data_miner'
|
2
|
+
require 'earth/industry/industries_sectors/data_miner'
|
1
3
|
require 'earth/industry/industry/data_miner'
|
4
|
+
require 'earth/industry/merchant/data_miner'
|
5
|
+
require 'earth/industry/merchant_categories_industries/data_miner'
|
2
6
|
require 'earth/industry/product_line/data_miner'
|
7
|
+
require 'earth/industry/product_lines_sectors/data_miner'
|
8
|
+
require 'earth/industry/sector/data_miner'
|
@@ -1,11 +1,11 @@
|
|
1
|
-
class IndustriesProductLines <
|
1
|
+
class IndustriesProductLines < Earth::Base
|
2
2
|
set_primary_key :row_hash
|
3
3
|
|
4
4
|
belongs_to :industry, :foreign_key => 'naics_code'
|
5
5
|
belongs_to :product_line, :foreign_key => 'ps_code'
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
def self.schema_definition
|
8
|
+
lambda do
|
9
9
|
string 'row_hash'
|
10
10
|
string 'naics_code'
|
11
11
|
float 'ratio'
|
@@ -13,4 +13,8 @@ class IndustriesProductLines < ActiveRecord::Base
|
|
13
13
|
float 'revenue_allocated'
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
17
|
+
data_miner do
|
18
|
+
IndustriesProductLines.define_schema(self)
|
19
|
+
end
|
16
20
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
IndustriesProductLines.class_eval do
|
2
|
+
data_miner do
|
3
|
+
IndustriesProductLines.define_schema(self)
|
4
|
+
|
5
|
+
import "sectors dictionary",
|
6
|
+
:url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdHV2dzdjdGVnLUJCdDA4TURXNThROVE&hl=en&single=true&gid=1&output=csv' do
|
7
|
+
key 'ps_code'
|
8
|
+
store 'naics_code'
|
9
|
+
store 'ratio'
|
10
|
+
store 'revenue_allocated'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,15 +1,16 @@
|
|
1
|
-
class IndustriesSectors <
|
2
|
-
set_primary_key :row_hash
|
3
|
-
|
1
|
+
class IndustriesSectors < Earth::Base
|
4
2
|
belongs_to :industry, :foreign_key => 'naics_code'
|
5
3
|
belongs_to :sector, :foreign_key => 'io_code'
|
6
4
|
|
7
|
-
|
8
|
-
|
9
|
-
string 'row_hash'
|
5
|
+
def self.schema_definition
|
6
|
+
lambda do
|
10
7
|
string 'naics_code'
|
11
8
|
float 'ratio'
|
12
9
|
string 'io_code'
|
13
10
|
end
|
14
11
|
end
|
12
|
+
|
13
|
+
data_miner do
|
14
|
+
IndustriesSectors.define_schema(self)
|
15
|
+
end
|
15
16
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
IndustriesSectors.class_eval do
|
2
|
+
data_miner do
|
3
|
+
IndustriesSectors.define_schema(self)
|
4
|
+
|
5
|
+
import "industries to sectors dictionary",
|
6
|
+
:url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdDVjVWRJdmVrcEtNd0U5Z3NxdGRlN1E&hl=en&single=true&gid=0&output=csv' do
|
7
|
+
key 'naics_code'
|
8
|
+
store 'ratio'
|
9
|
+
store 'io_code'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -1,13 +1,17 @@
|
|
1
|
-
class Merchant <
|
1
|
+
class Merchant < Earth::Base
|
2
2
|
set_primary_key :id
|
3
3
|
|
4
4
|
belongs_to :merchant_category, :foreign_key => 'mcc'
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
def self.schema_definition
|
7
|
+
lambda do
|
8
8
|
string 'id'
|
9
9
|
string 'name'
|
10
10
|
string 'mcc'
|
11
11
|
end
|
12
12
|
end
|
13
|
+
|
14
|
+
data_miner do
|
15
|
+
Merchant.define_schema(self)
|
16
|
+
end
|
13
17
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Merchant.class_eval do
|
2
|
+
data_miner do
|
3
|
+
Merchant.define_schema(self)
|
4
|
+
|
5
|
+
import "merchant dictionary",
|
6
|
+
:url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdElxWTd0ckpfVXJ6OVFxLUhwR0ZOVXc&hl=en&single=true&gid=0&output=csv' do
|
7
|
+
key 'id'
|
8
|
+
store 'name'
|
9
|
+
store 'mcc'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class MerchantCategoriesIndustries <
|
1
|
+
class MerchantCategoriesIndustries < Earth::Base
|
2
2
|
set_primary_key :row_hash
|
3
3
|
|
4
4
|
belongs_to :merchant_category, :foreign_key => 'mcc'
|
@@ -6,12 +6,15 @@ class MerchantCategoriesIndustries < ActiveRecord::Base
|
|
6
6
|
has_many :industries_product_lines, :through => :industry, :class_name => 'IndustriesProductLines'
|
7
7
|
has_many :industries_sectors, :through => :industry, :class_name => 'IndustriesSectors'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
string 'row_hash'
|
9
|
+
def self.schema_definition
|
10
|
+
lambda do
|
12
11
|
string 'mcc'
|
13
12
|
float 'ratio'
|
14
13
|
string 'naics_code'
|
15
14
|
end
|
16
15
|
end
|
16
|
+
|
17
|
+
data_miner do
|
18
|
+
MerchantCategoriesIndustries.define_schema(self)
|
19
|
+
end
|
17
20
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
MerchantCategoriesIndustries.class_eval do
|
2
|
+
data_miner do
|
3
|
+
MerchantCategoriesIndustries.define_schema(self)
|
4
|
+
|
5
|
+
import "merchant categories to industries dictionary",
|
6
|
+
:url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdHpDbjNwTHBmY252V01CQ1lOUUVMU1E&hl=en&single=true&gid=0&output=csv' do
|
7
|
+
key 'naics_code'
|
8
|
+
store 'mcc'
|
9
|
+
store 'ratio'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
MerchantCategory.class_eval do
|
2
|
+
data_miner do
|
3
|
+
MerchantCategory.define_schema(self)
|
4
|
+
|
5
|
+
import "merchant category dictionary",
|
6
|
+
:url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdEx2WGZpbTRLdzJub05VR3pyQThRMGc&hl=en&single=true&gid=0&output=csv' do
|
7
|
+
key 'mcc'
|
8
|
+
store 'description'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -1,15 +1,17 @@
|
|
1
|
-
class ProductLinesSectors <
|
2
|
-
set_primary_key :row_hash
|
3
|
-
|
1
|
+
class ProductLinesSectors < Earth::Base
|
4
2
|
belongs_to :product_line, :foreign_key => 'ps_code'
|
5
3
|
belongs_to :sector, :foreign_key => 'io_code'
|
6
4
|
|
7
|
-
|
8
|
-
|
5
|
+
def self.schema_definition
|
6
|
+
lambda do
|
9
7
|
string 'row_hash'
|
10
8
|
string 'ps_code'
|
11
9
|
float 'ratio'
|
12
10
|
string 'io_code'
|
13
11
|
end
|
14
12
|
end
|
13
|
+
|
14
|
+
data_miner do
|
15
|
+
ProductLinesSectors.define_schema(self)
|
16
|
+
end
|
15
17
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
ProductLinesSectors.class_eval do
|
2
|
+
data_miner do
|
3
|
+
ProductLinesSectors.define_schema(self)
|
4
|
+
|
5
|
+
import "product lines to sectors dictionary",
|
6
|
+
:url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdHRwWXRWai0tQnpxb2RfNFN3ZXROY1E&hl=en&single=true&gid=0&output=csv' do
|
7
|
+
key 'ps_code'
|
8
|
+
store 'ps_code_meaning'
|
9
|
+
store 'ratio'
|
10
|
+
store 'io_code'
|
11
|
+
store 'io_meaning'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class Sector <
|
1
|
+
class Sector < Earth::Base
|
2
2
|
set_primary_key :io_code
|
3
3
|
|
4
4
|
has_many :product_lines_sectors, :class_name => 'ProductLinesSectors', :foreign_key => 'io_code'
|
@@ -16,10 +16,16 @@ class Sector < ActiveRecord::Base
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
def self.schema_definition
|
20
|
+
lambda do
|
21
21
|
string 'io_code'
|
22
22
|
string 'description'
|
23
|
+
float 'emission_factor'
|
24
|
+
string 'emission_factor_units'
|
23
25
|
end
|
24
26
|
end
|
27
|
+
|
28
|
+
data_miner do
|
29
|
+
Sector.define_schema(self)
|
30
|
+
end
|
25
31
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Sector.class_eval do
|
2
|
+
data_miner do
|
3
|
+
Sector.define_schema(self)
|
4
|
+
|
5
|
+
import "sectors dictionary",
|
6
|
+
:url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdHV2dzdjdGVnLUJCdDA4TURXNThROVE&hl=en&single=true&gid=1&output=csv' do
|
7
|
+
key 'io_code'
|
8
|
+
store 'description'
|
9
|
+
store 'emission_factor'
|
10
|
+
store 'emission_factor_units'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
Earth.init :industry, :apply_schemas => true
|
3
|
+
|
4
|
+
describe IndustriesProductLines do
|
5
|
+
describe 'data_miner import' do
|
6
|
+
before :all do
|
7
|
+
require 'data_miner'
|
8
|
+
require 'earth/industry/industries_product_lines/data_miner'
|
9
|
+
end
|
10
|
+
it 'should import data' do
|
11
|
+
IndustriesProductLines.destroy_all
|
12
|
+
DataMiner.run :resource_names => 'IndustriesProductLines'
|
13
|
+
IndustriesProductLines.count.should > 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
Earth.init :industry, :apply_schemas => true
|
3
|
+
|
4
|
+
describe IndustriesSectors do
|
5
|
+
describe 'data_miner import' do
|
6
|
+
before :all do
|
7
|
+
require 'data_miner'
|
8
|
+
require 'earth/industry/industries_sectors/data_miner'
|
9
|
+
end
|
10
|
+
it 'should import data' do
|
11
|
+
IndustriesSectors.destroy_all
|
12
|
+
DataMiner.run :resource_names => 'IndustriesSectors'
|
13
|
+
IndustriesSectors.count.should > 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
Earth.init :industry, :apply_schemas => true
|
3
|
+
|
4
|
+
describe Industry do
|
5
|
+
describe 'data_miner import' do
|
6
|
+
before :all do
|
7
|
+
require 'data_miner'
|
8
|
+
require 'earth/industry/industry/data_miner'
|
9
|
+
end
|
10
|
+
it 'should import data' do
|
11
|
+
Industry.destroy_all
|
12
|
+
DataMiner.run :resource_names => 'Industry'
|
13
|
+
Industry.count.should > 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
Earth.init :industry, :apply_schemas => true
|
3
|
+
|
4
|
+
describe MerchantCategoriesIndustries do
|
5
|
+
describe 'data_miner import' do
|
6
|
+
before :all do
|
7
|
+
require 'data_miner'
|
8
|
+
require 'earth/industry/merchant/data_miner'
|
9
|
+
end
|
10
|
+
it 'should import data' do
|
11
|
+
MerchantCategoriesIndustries.destroy_all
|
12
|
+
DataMiner.run :resource_names => 'MerchantCategoriesIndustries'
|
13
|
+
MerchantCategoriesIndustries.count.should > 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
Earth.init :industry, :apply_schemas => true
|
3
|
+
|
4
|
+
describe MerchantCategory do
|
5
|
+
describe 'data_miner import' do
|
6
|
+
before :all do
|
7
|
+
require 'data_miner'
|
8
|
+
end
|
9
|
+
it 'should import data' do
|
10
|
+
MerchantCategory.destroy_all
|
11
|
+
DataMiner.run :resource_names => 'MerchantCategory'
|
12
|
+
MerchantCategory.count.should > 1
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
Earth.init :industry, :apply_schemas => true
|
3
|
+
|
4
|
+
describe Merchant do
|
5
|
+
describe 'data_miner import' do
|
6
|
+
before :all do
|
7
|
+
require 'data_miner'
|
8
|
+
require 'earth/industry/merchant/data_miner'
|
9
|
+
end
|
10
|
+
it 'should import data' do
|
11
|
+
Merchant.destroy_all
|
12
|
+
DataMiner.run :resource_names => 'Merchant'
|
13
|
+
Merchant.count.should > 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
Earth.init :industry, :apply_schemas => true
|
3
|
+
|
4
|
+
describe ProductLine do
|
5
|
+
describe 'data_miner import' do
|
6
|
+
before :all do
|
7
|
+
require 'data_miner'
|
8
|
+
require 'earth/industry/merchant/data_miner'
|
9
|
+
end
|
10
|
+
it 'should import data' do
|
11
|
+
ProductLine.destroy_all
|
12
|
+
DataMiner.run :resource_names => 'ProductLine'
|
13
|
+
ProductLine.count.should > 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
Earth.init :industry, :apply_schemas => true
|
3
|
+
|
4
|
+
describe ProductLinesSectors do
|
5
|
+
describe 'data_miner import' do
|
6
|
+
before :all do
|
7
|
+
require 'data_miner'
|
8
|
+
require 'earth/industry/merchant/data_miner'
|
9
|
+
end
|
10
|
+
it 'should import data' do
|
11
|
+
ProductLinesSectors.destroy_all
|
12
|
+
DataMiner.run :resource_names => 'ProductLinesSectors'
|
13
|
+
ProductLinesSectors.count.should > 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -77,5 +77,18 @@ describe Sector do
|
|
77
77
|
}
|
78
78
|
end
|
79
79
|
end
|
80
|
+
|
81
|
+
describe 'data_miner import' do
|
82
|
+
before :all do
|
83
|
+
require 'data_miner'
|
84
|
+
require 'earth/industry/sector/data_miner'
|
85
|
+
end
|
86
|
+
it 'should import data' do
|
87
|
+
Sector.destroy_all
|
88
|
+
DataMiner.run :resource_names => 'Sector'
|
89
|
+
Sector.count.should > 1
|
90
|
+
Sector.first.emission_factor_units.should == 'kilograms_per_2002_dollar'
|
91
|
+
end
|
92
|
+
end
|
80
93
|
end
|
81
94
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
Earth.init :industry, :apply_schemas => true
|
3
|
+
|
4
|
+
describe IndustriesProductLines do
|
5
|
+
describe 'data_miner import' do
|
6
|
+
before :all do
|
7
|
+
require 'data_miner'
|
8
|
+
require 'earth/industry/industries_product_lines/data_miner'
|
9
|
+
end
|
10
|
+
it 'should import data' do
|
11
|
+
IndustriesProductLines.destroy_all
|
12
|
+
DataMiner.run :resource_names => 'IndustriesProductLines'
|
13
|
+
IndustriesProductLines.count.should > 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: earth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 33
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 31
|
10
|
+
version: 0.0.31
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Seamus Abshere
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2010-09-07 00:00:00 -
|
20
|
+
date: 2010-09-07 00:00:00 -04:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -28,7 +28,7 @@ dependencies:
|
|
28
28
|
requirements:
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
hash:
|
31
|
+
hash: -1848230024
|
32
32
|
segments:
|
33
33
|
- 3
|
34
34
|
- 0
|
@@ -267,6 +267,7 @@ files:
|
|
267
267
|
- lib/earth/automobile/automobile_variant.rb
|
268
268
|
- lib/earth/automobile/automobile_variant/data_miner.rb
|
269
269
|
- lib/earth/automobile/data_miner.rb
|
270
|
+
- lib/earth/base.rb
|
270
271
|
- lib/earth/bus.rb
|
271
272
|
- lib/earth/bus/bus_class.rb
|
272
273
|
- lib/earth/bus/bus_class/data_miner.rb
|
@@ -288,16 +289,23 @@ files:
|
|
288
289
|
- lib/earth/industry.rb
|
289
290
|
- lib/earth/industry/data_miner.rb
|
290
291
|
- lib/earth/industry/industries_product_lines.rb
|
292
|
+
- lib/earth/industry/industries_product_lines/data_miner.rb
|
291
293
|
- lib/earth/industry/industries_sectors.rb
|
294
|
+
- lib/earth/industry/industries_sectors/data_miner.rb
|
292
295
|
- lib/earth/industry/industry.rb
|
293
296
|
- lib/earth/industry/industry/data_miner.rb
|
294
297
|
- lib/earth/industry/merchant.rb
|
298
|
+
- lib/earth/industry/merchant/data_miner.rb
|
295
299
|
- lib/earth/industry/merchant_categories_industries.rb
|
300
|
+
- lib/earth/industry/merchant_categories_industries/data_miner.rb
|
296
301
|
- lib/earth/industry/merchant_category.rb
|
302
|
+
- lib/earth/industry/merchant_category/data_miner.rb
|
297
303
|
- lib/earth/industry/product_line.rb
|
298
304
|
- lib/earth/industry/product_line/data_miner.rb
|
299
305
|
- lib/earth/industry/product_lines_sectors.rb
|
306
|
+
- lib/earth/industry/product_lines_sectors/data_miner.rb
|
300
307
|
- lib/earth/industry/sector.rb
|
308
|
+
- lib/earth/industry/sector/data_miner.rb
|
301
309
|
- lib/earth/inflectors.rb
|
302
310
|
- lib/earth/locality.rb
|
303
311
|
- lib/earth/locality/census_division.rb
|
@@ -396,8 +404,17 @@ files:
|
|
396
404
|
- vendor/geokit-rails/test/schema.rb
|
397
405
|
- vendor/geokit-rails/test/tasks.rake
|
398
406
|
- vendor/geokit-rails/test/test_helper.rb
|
407
|
+
- spec/lib/earth/industry/industries_product_lines_spec.rb
|
408
|
+
- spec/lib/earth/industry/industries_sectors_spec.rb
|
409
|
+
- spec/lib/earth/industry/industry_spec.rb
|
410
|
+
- spec/lib/earth/industry/merchant_categories_industries_spec.rb
|
411
|
+
- spec/lib/earth/industry/merchant_category_spec.rb
|
412
|
+
- spec/lib/earth/industry/merchant_spec.rb
|
413
|
+
- spec/lib/earth/industry/product_line_spec.rb
|
414
|
+
- spec/lib/earth/industry/product_lines_sectors_spec.rb
|
399
415
|
- spec/lib/earth/industry/sector_spec.rb
|
400
416
|
- spec/lib/earth_spec.rb
|
417
|
+
- spec/lib/industries_sectors_spec.rb
|
401
418
|
- spec/spec_helper.rb
|
402
419
|
- Gemfile
|
403
420
|
- Gemfile.lock
|
@@ -436,8 +453,17 @@ signing_key:
|
|
436
453
|
specification_version: 3
|
437
454
|
summary: Land, sky, and sea
|
438
455
|
test_files:
|
456
|
+
- spec/lib/earth/industry/industries_product_lines_spec.rb
|
457
|
+
- spec/lib/earth/industry/industries_sectors_spec.rb
|
458
|
+
- spec/lib/earth/industry/industry_spec.rb
|
459
|
+
- spec/lib/earth/industry/merchant_categories_industries_spec.rb
|
460
|
+
- spec/lib/earth/industry/merchant_category_spec.rb
|
461
|
+
- spec/lib/earth/industry/merchant_spec.rb
|
462
|
+
- spec/lib/earth/industry/product_line_spec.rb
|
463
|
+
- spec/lib/earth/industry/product_lines_sectors_spec.rb
|
439
464
|
- spec/lib/earth/industry/sector_spec.rb
|
440
465
|
- spec/lib/earth_spec.rb
|
466
|
+
- spec/lib/industries_sectors_spec.rb
|
441
467
|
- spec/spec_helper.rb
|
442
468
|
- Gemfile
|
443
469
|
- Gemfile.lock
|