fredric 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ab13d78501098fa5e1cafb3c9089f7deefac6f6
4
- data.tar.gz: a8413186c16bff59656c73441a53fd94e75d0e11
3
+ metadata.gz: aeded696850394a227db2c59808569535a5d330f
4
+ data.tar.gz: f27002ee98c5af408210938274f60f3980fc79b8
5
5
  SHA512:
6
- metadata.gz: 0f95fb9b07eb270839e83bd0af6c1545a447d98cf7fa3f9365cfeffd1006d9645d1c06ea69110de171132363195f2a5adf8655a0690a49202bd5f25d483d0ed5
7
- data.tar.gz: a2d276a7191adce89b28e5a774c9e146c8d1205a3239decb56c3c42a6cd93e63bffac613987a67aeb9517ccb410013fa5d5d68f46bcdd35ae6700bdf275f687d
6
+ metadata.gz: f23601ce059eecc8db1eb283a25a00df26228f61894449d155dcdbc9e1277ca0a8bd425ebc4d6f59b849c46b35f4e0539c878ca6555a43e7381cbaeb57481cd4
7
+ data.tar.gz: fe256721ce32f02248f9d5118bac89213d7a25ac62f1c1ab26a8708d56836366cfd8f4bb1ba99e028ed3f1247fcc90e42564131df1734842456a6be8ee109191
data/README.md CHANGED
@@ -46,7 +46,7 @@ First, require and initialize with your [FRED API Key][4].
46
46
 
47
47
  ```ruby
48
48
  require 'fredric'
49
- fredric = Fredric::API.new api_key: 'y0urAP1k3y'
49
+ fredric = Fredric::API.new 'your-api-key'
50
50
  ```
51
51
 
52
52
  Now, you can access any FRED endpoint with any optional parameter, like
@@ -192,7 +192,7 @@ these environment variables:
192
192
  ```
193
193
  $ export FREDRIC_CACHE_DIR=cache # default: 'cache'
194
194
  $ export FREDRIC_CACHE_LIFE=120 # default: 3600 (1 hour)
195
- $ fredric get indices
195
+ $ fred see category/children
196
196
  # => This call will be cached
197
197
  ```
198
198
 
@@ -201,3 +201,4 @@ $ fredric get indices
201
201
  [2]: https://github.com/DannyBen/fredric/blob/master/lib/fredric/docopt.txt
202
202
  [3]: https://github.com/DannyBen/webcache
203
203
  [4]: https://research.stlouisfed.org/docs/api/api_key.html
204
+
data/lib/fredric/api.rb CHANGED
@@ -38,7 +38,7 @@ module Fredric
38
38
  end
39
39
 
40
40
  def get_csv(*args)
41
- response = get *args
41
+ response = get(*args)
42
42
 
43
43
  raise Fredric::BadResponse, "API said '#{response}'" if response.is_a? String
44
44
  raise Fredric::BadResponse, "Got a #{response.class}, expected a Hash" unless response.is_a? Hash
@@ -55,7 +55,7 @@ module Fredric
55
55
  end
56
56
 
57
57
  def save_csv(file, *args)
58
- data = get_csv *args
58
+ data = get_csv(*args)
59
59
  File.write file, data
60
60
  end
61
61
 
@@ -57,5 +57,14 @@ Environment Variables:
57
57
  will not be cached.
58
58
 
59
59
  Examples:
60
+ fred see category/children
60
61
  fred see series/observations series_id:GNPCA
61
- fred get --csv series/observations series_id:GNPCA
62
+ fred get --csv series/observations series_id:GNPCA
63
+ fred see series/search "search_text:consumer price index" limit:3
64
+ fred save result.json series/search search_text:cpi limit:3
65
+ fred save --csv result.csv series/observations series_id:GNPCA
66
+
67
+ Additional Information:
68
+ Fredric Home: https://github.com/DannyBen/fredric
69
+ FRED API Docs: https://research.stlouisfed.org/docs/api/fred/
70
+
@@ -1,3 +1,3 @@
1
1
  module Fredric
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fredric
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
  - Danny Ben Shitrit
@@ -167,7 +167,7 @@ files:
167
167
  - lib/fredric/exceptions.rb
168
168
  - lib/fredric/version.rb
169
169
  - lib/fredric/web_api.rb
170
- homepage: https://github.com/DannyBen/fred
170
+ homepage: https://github.com/DannyBen/fredric
171
171
  licenses:
172
172
  - MIT
173
173
  metadata: {}