usda-nutrient-database 0.2.0 → 0.3.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 +4 -4
- data/lib/tasks/usda_nutrient_database.rake +10 -0
- data/lib/usda_nutrient_database/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 831e4c2f89dfafdc47775cc8dec3cebdbcd1914c
|
|
4
|
+
data.tar.gz: 785a041f065074cdc8dd8b66167821f01767cf71
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2cd55cae7aaa1fd439d8ae4e94753ade9517b923c39cc8122edd8e7630159130469c35862668609f1150d6359669b33cc37d150f5b6a02bbd7376e42c1ab0fa7
|
|
7
|
+
data.tar.gz: 6dee23c9fa9c7090ff540fa80e5e5570a8306539146c530c569bbfa0c09b66e217180e98fe93afd03e01ee4c1fecac0ce7fce7fd84f515a48563d3b3376b3538
|
|
@@ -3,4 +3,14 @@ namespace :usda do
|
|
|
3
3
|
task import: :environment do
|
|
4
4
|
UsdaNutrientDatabase::Importer.new('tmp/usda', 'sr25').import
|
|
5
5
|
end
|
|
6
|
+
|
|
7
|
+
desc 'Import the USDA weights table'
|
|
8
|
+
task import_weights: :environment do
|
|
9
|
+
UsdaNutrientDatabase::Import::Downloader.new('tmp/usda', 'sr25').
|
|
10
|
+
tap do |downloader|
|
|
11
|
+
downloader.download_and_unzip
|
|
12
|
+
UsdaNutrientDatabase::Import::Weights.new('tmp/usda/sr25').import
|
|
13
|
+
downloader.cleanup
|
|
14
|
+
end
|
|
15
|
+
end
|
|
6
16
|
end
|