usda-nutrient-database 0.5.0 → 0.6.0
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 647906ce598ce7cea75fa74b70f0dd2522d1f9dd
|
|
4
|
+
data.tar.gz: 1030b4cb7d1b668c4e2c866bef500fa88f7fc656
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c7bf956846e0c5acd1979a8c63189a73029f43bda0da70540ed5021dcf6c799c4cc824fba8e4e329d79f2247eda46c8f8ef22cd1acb7ff0b301d01d54455645
|
|
7
|
+
data.tar.gz: aef31c4e423bdc6d412a375925360ffa58861c5deb49092aa7be270ead4e2de5991b5c7cb4dcceb4357b6c0d61f851f682a962febd6a60949a80b7e0b4e7985d
|
|
@@ -6,10 +6,20 @@ namespace :usda do
|
|
|
6
6
|
|
|
7
7
|
desc 'Import the USDA weights table'
|
|
8
8
|
task import_weights: :environment do
|
|
9
|
+
download_and_import('Weights')
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
desc 'Import USDA foot notes data'
|
|
13
|
+
task import_footnotes: :environment do
|
|
14
|
+
download_and_import('Footnotes')
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def download_and_import(importer_name)
|
|
9
18
|
UsdaNutrientDatabase::Import::Downloader.new('tmp/usda', 'sr25').
|
|
10
19
|
tap do |downloader|
|
|
11
20
|
downloader.download_and_unzip
|
|
12
|
-
UsdaNutrientDatabase::Import
|
|
21
|
+
"UsdaNutrientDatabase::Import::#{importer_name}".constantize.
|
|
22
|
+
new('tmp/usda/sr25').import
|
|
13
23
|
downloader.cleanup
|
|
14
24
|
end
|
|
15
25
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: usda-nutrient-database
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Beedle
|
|
@@ -197,8 +197,7 @@ files:
|
|
|
197
197
|
- db/migrate/3_create_usda_foods_nutrients.rb
|
|
198
198
|
- db/migrate/4_create_usda_nutrients.rb
|
|
199
199
|
- db/migrate/5_create_usda_weights.rb
|
|
200
|
-
- db/migrate/
|
|
201
|
-
- lib/tasks/usda_nutrient_database.rake
|
|
200
|
+
- db/migrate/6_create_usda_footnotes.rb
|
|
202
201
|
- lib/usda-nutrient-database.rb
|
|
203
202
|
- lib/usda_nutrient_database/configuration.rb
|
|
204
203
|
- lib/usda_nutrient_database/engine.rb
|
|
@@ -217,6 +216,7 @@ files:
|
|
|
217
216
|
- lib/usda_nutrient_database/importer.rb
|
|
218
217
|
- lib/usda_nutrient_database/nutrient.rb
|
|
219
218
|
- lib/usda_nutrient_database/railtie.rb
|
|
219
|
+
- lib/usda_nutrient_database/tasks/usda_nutrient_database.rake
|
|
220
220
|
- lib/usda_nutrient_database/version.rb
|
|
221
221
|
- lib/usda_nutrient_database/weight.rb
|
|
222
222
|
- spec/database.yml
|