usda_ndb 0.0.1 → 0.0.2

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: 925666bdce26739c134f221060f10817e35605ac
4
- data.tar.gz: d9b673b8eab17a56534e336c875cdf9abd294677
3
+ metadata.gz: 9d66e76d9049ebeb3bb131ed96dfc7bdb3e2cc5c
4
+ data.tar.gz: 3dde17aee58a6292c43b8ad61bf9275a3c40ed19
5
5
  SHA512:
6
- metadata.gz: 3812126c9670a815985530f442a4e02e68ecf8f5791250797a8e55e760109a56d4598bf6595992dd1df020b7d43de90aa5a972e3cef7be5951b780cb217a7e07
7
- data.tar.gz: bacfd2e1caf990bf93e383d2b24ba66deb3fb6db2d2269736758033d67c401aa893397e2629e730429b5755c7cf22b99efe62df34f99a1102a1885f1abc7a2c9
6
+ metadata.gz: 369c41ff2df060fe89c91f0a3f45fa91e6cf4a6d6bafb09f49322a2fa2c3bd1db5e710aef7dab8fc91aeb1d8c3523ddbd7448a50b7302b420dcf5b7378f4ca21
7
+ data.tar.gz: 0c35577084d0a194d97e7cdca5abc561bafdd9dcb1487bf7c229afd81ff0e15b64d646519bcedce114c0e5f7521057973fa2ebfdbb593e715c8aacdbf3091769
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # UsdaNdb
2
2
 
3
- A ruby gem wrapping API of USDA National Nutrient Database.
3
+ A ruby gem wrapping API of USDA National Nutrient Database which will let you
4
+ instantly search for nutrition data.
5
+ You may also consider importing the database with usda-nutrient-database gem.
4
6
 
5
7
  ## Installation
6
8
 
@@ -20,7 +22,7 @@ Or install it yourself as:
20
22
 
21
23
  ## Usage
22
24
 
23
- Visit http://ndb.nal.usda.gov/ndb/api/doc and get a free data.gov API key. Then create initializer
25
+ Visit https://api.data.gov/signup/ and get a free data.gov API key. Then create initializer
24
26
 
25
27
  $ rails generate usda_ndb:install
26
28
 
@@ -40,8 +42,8 @@ UsdaNdb.reports('01208')
40
42
  # => {"report"=>{"sr"=>"28", "type"=>"Basic", "food"=>{"ndbno"=>"01208", "name"=>"Cheese, provolone, reduced fat", "nutrients"=>[{"nutrient_id"=>"255", "name"=>"Water", ...
41
43
 
42
44
  # to search for products
43
- UsdaNdb.search('cheese')
44
- # => {"list"=>{"q"=>"cheese", "sr"=>"28", "start"=>0, "end"=>150, "total"=>312, "group"=>"", "sort"=>"r", "item"=>[{"offset"=>0, "group"=>"Dairy and Egg Products", "name"=>"Cheese spread, cream cheese base", "ndbno"=>"43276"}, ...
45
+ UsdaNdb.search('apple raw')
46
+ # => {"list"=>{"q"=>"apple raw", "sr"=>"28", "ds"=>"any", "start"=>0, "end"=>22, "total"=>22, "group"=>"", "sort"=>"r", "item"=>[{"offset"=>0, "group"=>"Fruits and Fruit Juices", "name"=>"Apples, raw, with skin", "ndbno"=>"09003", "ds"=>"SR"}, ...
45
47
 
46
48
  # to list products
47
49
  UsdaNdb.list
@@ -1,3 +1,3 @@
1
1
  module UsdaNdb
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
data/lib/usda_ndb.rb CHANGED
@@ -3,6 +3,7 @@ require 'usda_ndb/version'
3
3
  require 'usda_ndb/configurable'
4
4
  require 'usda_ndb/configuration'
5
5
  require 'rest-client'
6
+ require 'json'
6
7
 
7
8
  module UsdaNdb
8
9
  extend UsdaNdb::Configurable
data/usda_ndb.gemspec CHANGED
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency 'rspec'
26
26
  spec.add_development_dependency 'vcr'
27
27
  spec.add_development_dependency 'webmock'
28
+ spec.add_development_dependency 'pry'
28
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usda_ndb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - aTeapot
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-04 00:00:00.000000000 Z
11
+ date: 2017-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: pry
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description:
98
112
  email:
99
113
  - latem999@o2.pl
@@ -139,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
153
  version: '0'
140
154
  requirements: []
141
155
  rubyforge_project:
142
- rubygems_version: 2.4.6
156
+ rubygems_version: 2.6.8
143
157
  signing_key:
144
158
  specification_version: 4
145
159
  summary: Wrapper for USDA National Nutrient Database API