quata 0.1.1 → 0.1.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: bea40dfd8ef5efedbf07a77c86c87c6bfed9ecea
4
- data.tar.gz: f4cf1fada28faca37b9182d764600a46d38215ab
3
+ metadata.gz: 580e41302fffc675f215c6e0be760ee1c12331d1
4
+ data.tar.gz: 2366adc0b92c05bb7b7fb3535c32cace572274fb
5
5
  SHA512:
6
- metadata.gz: 2a75b9169a54d446a29262a56cc77e9c32033c1013db752bca777dd0a93666d4c6d818e58d9647bfe7c07ddf3a35f387e62dfbff8c8356ebfa57715db27c03ec
7
- data.tar.gz: 376ba5b8b932047a37fbd35e7d57aa37768a04e926162c0d58977e3ca3dbad3408224b5d38ef16c4252ec18a9777591b81c3245417e389f829ca7d159e5d2c50
6
+ metadata.gz: 013f37a822659606f555ccc6c3c3f454e3b57b18a24f84234947812509e2455f8102d7ee46768751ec903019cb40038956095b5a4c585558dcee10a0fcce9979
7
+ data.tar.gz: 1d70b2d056137211277eb9e59070d3c8946a10eb14b4be974b39a22c5b39b863b9717d855383894df6d1bc41c410b04aa0ec014f9748d5000127867fae99b3db
data/README.md CHANGED
@@ -24,7 +24,7 @@ Features
24
24
  * Display output in various formats.
25
25
  * Save output to a file, including bulk downloads.
26
26
 
27
- Example
27
+ Usage
28
28
  --------------------------------------------------
29
29
 
30
30
  First, require and initialize with your API key
@@ -68,10 +68,11 @@ you for the following requests is also easy:
68
68
 
69
69
  ```ruby
70
70
  quandl.debug true
71
- quandl.param :rows, 10
72
- quandl.param :order, 'asc'
71
+ quandl.param rows: 10, order: 'asc'
73
72
  puts quandl.get 'WIKI/AAPL'
74
- => https://www.quandl.com/api/v3/WIKI/AAPL.json?auth_token=key&rows=10&order=asc
73
+ # => https://www.quandl.com/api/v3/WIKI/AAPL.json?auth_token=key&rows=10&order=asc
74
+
75
+ quandl.param order: nil # remove param
75
76
  ```
76
77
 
77
78
  Command Line
@@ -124,5 +125,7 @@ $ quata url datasets/WIKI/AAPL rows:5
124
125
  # => https://www.quandl.com/api/v3/datasets/WIKI/AAPL.csv?auth_token=YOUR_KEY&rows=5
125
126
  ```
126
127
 
128
+ ![Quata Demo](https://raw.githubusercontent.com/DannyBen/quata/master/demo.gif "Quata Demo")
129
+
127
130
  [1]: https://www.quandl.com/blog/getting-started-with-the-quandl-api
128
131
  [2]: https://github.com/DannyBen/quata/blob/master/lib/quata/docopt.txt
data/lib/quata/quandl.rb CHANGED
@@ -9,7 +9,7 @@ class Quandl < Quata::WebAPI
9
9
 
10
10
  base_url ||= 'https://www.quandl.com/api/v3'
11
11
 
12
- param :auth_token, api_key if api_key
12
+ param auth_token: api_key if api_key
13
13
  format :json
14
14
 
15
15
  after_request do |response|
data/lib/quata/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Quata
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/quata/web_api.rb CHANGED
@@ -22,10 +22,13 @@ module Quata
22
22
  end
23
23
  end
24
24
 
25
- # Add a parameter to the default query string. Good for adding keys that
26
- # are always needed, like API keys.
27
- def param(key, value)
28
- default_params[key] = value
25
+ # Add one or more parameter to the default query string. Good for
26
+ # adding keys that are always needed, like API keys.
27
+ def param(params)
28
+ params.each do |key, value|
29
+ default_params[key] = value
30
+ default_params.delete key if value.nil?
31
+ end
29
32
  end
30
33
 
31
34
  # Set the default format that will be appended to the URL. value can be
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-19 00:00:00.000000000 Z
11
+ date: 2016-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt