quandl_client 2.4.1 → 2.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/UPGRADE.md +5 -0
- data/examples/create.rb +1 -1
- data/examples/login.rb +1 -1
- data/examples/search.rb +1 -2
- data/lib/quandl/client/models/dataset.rb +10 -2
- data/lib/quandl/client/version.rb +1 -1
- data/spec/lib/quandl/client/dataset_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d222b6568a424c6165fe84f631fb6909017c50fa
|
4
|
+
data.tar.gz: 98601a107de7563ced984f4cef9535c8eb236846
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94625b5c6c237732457a5ddeb9de0c1d1eab3c5c849c1ffc70d4a11cea3ad842ca6495387f4ad564e5ee6dc5993f6ef2bfbfa54042c0fdfae744e4036e137c70
|
7
|
+
data.tar.gz: 58fb42c03d9ce26b0e7df4064c60f95932697fd89a482c8267d36279def0ea00ee4336e17a0b06e117188456fcad79215e2275d5e6918ab7466bb73938c9e115
|
data/UPGRADE.md
CHANGED
data/examples/create.rb
CHANGED
data/examples/login.rb
CHANGED
data/examples/search.rb
CHANGED
@@ -5,8 +5,7 @@ require "quandl/client"
|
|
5
5
|
|
6
6
|
include Quandl::Client
|
7
7
|
|
8
|
-
Quandl::Client.use ENV['
|
9
|
-
# Quandl::Client.use 'http://staging.quandl.com/api/'
|
8
|
+
Quandl::Client.use ENV['QUANDL_TEST_URL']
|
10
9
|
Quandl::Client.token = ENV['QUANDL_TEST_TOKEN']
|
11
10
|
|
12
11
|
datasets = Dataset.query('water').all
|
@@ -5,9 +5,17 @@ class Quandl::Client::Dataset < Quandl::Client::Base
|
|
5
5
|
##########
|
6
6
|
# SCOPES #
|
7
7
|
##########
|
8
|
+
class << self
|
9
|
+
def touch_existing(id)
|
10
|
+
put(File.join(Quandl::Client::Base.url_with_version, "datasets/#{id}/touch")).exists?
|
11
|
+
end
|
12
|
+
|
13
|
+
def find(value)
|
14
|
+
# short-circuit if value is illegal
|
15
|
+
return nil unless value.is_a?(Integer) || value.to_s =~ %r{^#{Quandl::Pattern.full_code}$}
|
16
|
+
super(value)
|
17
|
+
end
|
8
18
|
|
9
|
-
def self.touch_existing(id)
|
10
|
-
put(File.join(Quandl::Client::Base.url_with_version, "datasets/#{id}/touch")).exists?
|
11
19
|
end
|
12
20
|
|
13
21
|
# SEARCH
|
@@ -5,6 +5,22 @@ describe Dataset do
|
|
5
5
|
let(:dataset){ create(:dataset) }
|
6
6
|
subject{ dataset }
|
7
7
|
|
8
|
+
describe ".find" do
|
9
|
+
subject{ Dataset.find(query) }
|
10
|
+
context "given nil" do
|
11
|
+
let(:query){ nil }
|
12
|
+
it{ should be_nil }
|
13
|
+
end
|
14
|
+
context "given empty string" do
|
15
|
+
let(:query){ '' }
|
16
|
+
it{ should be_nil }
|
17
|
+
end
|
18
|
+
context "given non-code value" do
|
19
|
+
let(:query){ '/' }
|
20
|
+
it{ should be_nil }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
8
24
|
describe ".touch_existing(:id)" do
|
9
25
|
it "should touch the dataset" do
|
10
26
|
dataset.updated_at
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quandl_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Hilscher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|