quandl_client 2.7.5 → 2.7.6
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.
- data/.gitignore +7 -7
- data/.rspec +1 -1
- data/.travis.yml +20 -20
- data/.yardopts +2 -2
- data/Gemfile +12 -12
- data/Guardfile +8 -8
- data/LICENSE +7 -7
- data/README.md +303 -303
- data/Rakefile +31 -35
- data/UPGRADE.md +190 -213
- data/VERSION +1 -1
- data/examples/create.rb +32 -32
- data/examples/find.rb +17 -17
- data/examples/login.rb +12 -12
- data/examples/search.rb +12 -12
- data/examples/trims.rb +15 -15
- data/lib/quandl/client.rb +49 -49
- data/lib/quandl/client/base.rb +91 -91
- data/lib/quandl/client/base/attributes.rb +15 -15
- data/lib/quandl/client/base/model.rb +40 -40
- data/lib/quandl/client/base/search.rb +74 -74
- data/lib/quandl/client/base/validation.rb +101 -101
- data/lib/quandl/client/middleware.rb +9 -9
- data/lib/quandl/client/middleware/parse_json.rb +85 -85
- data/lib/quandl/client/models/dataset.rb +261 -245
- data/lib/quandl/client/models/dataset/data.rb +57 -57
- data/lib/quandl/client/models/location.rb +10 -10
- data/lib/quandl/client/models/report.rb +14 -14
- data/lib/quandl/client/models/scraper.rb +16 -16
- data/lib/quandl/client/models/sheet.rb +50 -50
- data/lib/quandl/client/models/source.rb +48 -40
- data/lib/quandl/client/models/superset.rb +59 -59
- data/lib/quandl/client/models/user.rb +7 -7
- data/lib/quandl/client/version.rb +14 -14
- data/lib/quandl/her/remove_method_data.rb +8 -8
- data/lib/quandl/pattern.rb +37 -37
- data/lib/quandl/pattern/client.rb +8 -8
- data/quandl_client.gemspec +33 -33
- data/spec/factories/dataset.rb +10 -10
- data/spec/factories/sheet.rb +7 -7
- data/spec/factories/source.rb +9 -9
- data/spec/fixtures/scraper.rb +5 -5
- data/spec/lib/quandl/client/dataset/attributes_spec.rb +63 -63
- data/spec/lib/quandl/client/dataset/data_spec.rb +92 -92
- data/spec/lib/quandl/client/dataset/location_spec.rb +65 -65
- data/spec/lib/quandl/client/dataset/persistence_spec.rb +104 -104
- data/spec/lib/quandl/client/dataset/search_spec.rb +19 -19
- data/spec/lib/quandl/client/dataset/source_spec.rb +47 -47
- data/spec/lib/quandl/client/dataset/trim_spec.rb +35 -35
- data/spec/lib/quandl/client/dataset/validation_spec.rb +68 -68
- data/spec/lib/quandl/client/dataset_spec.rb +57 -57
- data/spec/lib/quandl/client/scraper_spec.rb +71 -71
- data/spec/lib/quandl/client/sheet_spec.rb +37 -37
- data/spec/lib/quandl/client/source_spec.rb +51 -51
- data/spec/spec_helper.rb +30 -30
- metadata +27 -5
@@ -1,38 +1,38 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
describe Sheet do
|
5
|
-
|
6
|
-
before(:all){ Quandl::Client.token = ENV['QUANDL_AUTH_TOKEN'] }
|
7
|
-
|
8
|
-
let(:sheet){ build(:sheet) }
|
9
|
-
|
10
|
-
subject{ sheet }
|
11
|
-
|
12
|
-
its(:valid?){ should be_true }
|
13
|
-
|
14
|
-
context "when saved" do
|
15
|
-
|
16
|
-
before(:each){ subject.save }
|
17
|
-
|
18
|
-
its(:saved?){ should be_true }
|
19
|
-
|
20
|
-
describe "#description" do
|
21
|
-
|
22
|
-
its(:description){ should eq "Test sheet description." }
|
23
|
-
|
24
|
-
it "should find the description" do
|
25
|
-
Sheet.find( subject.id ).description.should eq "Test sheet description."
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should update the description" do
|
29
|
-
subject.description = "New description."
|
30
|
-
subject.save
|
31
|
-
Sheet.find( subject.id ).description.should eq "New description."
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Sheet do
|
5
|
+
|
6
|
+
before(:all){ Quandl::Client.token = ENV['QUANDL_AUTH_TOKEN'] }
|
7
|
+
|
8
|
+
let(:sheet){ build(:sheet) }
|
9
|
+
|
10
|
+
subject{ sheet }
|
11
|
+
|
12
|
+
its(:valid?){ should be_true }
|
13
|
+
|
14
|
+
context "when saved" do
|
15
|
+
|
16
|
+
before(:each){ subject.save }
|
17
|
+
|
18
|
+
its(:saved?){ should be_true }
|
19
|
+
|
20
|
+
describe "#description" do
|
21
|
+
|
22
|
+
its(:description){ should eq "Test sheet description." }
|
23
|
+
|
24
|
+
it "should find the description" do
|
25
|
+
Sheet.find( subject.id ).description.should eq "Test sheet description."
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should update the description" do
|
29
|
+
subject.description = "New description."
|
30
|
+
subject.save
|
31
|
+
Sheet.find( subject.id ).description.should eq "New description."
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
38
|
end
|
@@ -1,51 +1,51 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
describe Source do
|
5
|
-
|
6
|
-
let(:source){ build(:source) }
|
7
|
-
|
8
|
-
context "without token" do
|
9
|
-
|
10
|
-
before(:all){ Quandl::Client.token = '' }
|
11
|
-
|
12
|
-
subject{ source }
|
13
|
-
|
14
|
-
its(:valid?){ should be_true }
|
15
|
-
|
16
|
-
describe "#save" do
|
17
|
-
|
18
|
-
it "should not be authorized to create a source" do
|
19
|
-
source.save
|
20
|
-
source.status.should eq 401
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
|
27
|
-
context "with token" do
|
28
|
-
|
29
|
-
before(:all){ Quandl::Client.token = ENV['
|
30
|
-
|
31
|
-
describe "#save" do
|
32
|
-
|
33
|
-
it "should save the source" do
|
34
|
-
source.save
|
35
|
-
source.status.should eq 201
|
36
|
-
end
|
37
|
-
|
38
|
-
it "should update the source" do
|
39
|
-
source.save
|
40
|
-
retrieved_source = Source.find(source.id)
|
41
|
-
retrieved_source.description = "something new #{Time.now}"
|
42
|
-
retrieved_source.save
|
43
|
-
Source.find(source.id).description.should eq retrieved_source.description
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Source do
|
5
|
+
|
6
|
+
let(:source){ build(:source) }
|
7
|
+
|
8
|
+
context "without token" do
|
9
|
+
|
10
|
+
before(:all){ Quandl::Client.token = '' }
|
11
|
+
|
12
|
+
subject{ source }
|
13
|
+
|
14
|
+
its(:valid?){ should be_true }
|
15
|
+
|
16
|
+
describe "#save" do
|
17
|
+
|
18
|
+
it "should not be authorized to create a source" do
|
19
|
+
source.save
|
20
|
+
source.status.should eq 401
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
context "with token" do
|
28
|
+
|
29
|
+
before(:all){ Quandl::Client.token = ENV['QUANDL_USER_TOKEN'] }
|
30
|
+
|
31
|
+
describe "#save" do
|
32
|
+
|
33
|
+
it "should save the source" do
|
34
|
+
source.save
|
35
|
+
source.status.should eq 201
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should update the source" do
|
39
|
+
source.save
|
40
|
+
retrieved_source = Source.find(source.id)
|
41
|
+
retrieved_source.description = "something new #{Time.now}"
|
42
|
+
retrieved_source.save
|
43
|
+
Source.find(source.id).description.should eq retrieved_source.description
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,31 +1,31 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
-
|
3
|
-
require "rspec"
|
4
|
-
require 'factory_girl'
|
5
|
-
require 'pry'
|
6
|
-
|
7
|
-
factory_dir = File.join( File.dirname(__FILE__), 'factories/**/*.rb' )
|
8
|
-
Dir.glob( factory_dir ).each{|f| require(f); puts f }
|
9
|
-
|
10
|
-
require "quandl/client"
|
11
|
-
require "quandl/fabricate"
|
12
|
-
|
13
|
-
# Expects two env variables:
|
14
|
-
|
15
|
-
# administrator:
|
16
|
-
# ENV['QUANDL_AUTH_TOKEN']
|
17
|
-
|
18
|
-
# user:
|
19
|
-
# ENV['QUANDL_TEST_TOKEN']
|
20
|
-
|
21
|
-
include Quandl::Client
|
22
|
-
Quandl::Client.token = ENV['QUANDL_AUTH_TOKEN']
|
23
|
-
Quandl::Client.use ENV['QUANDL_TEST_URL']
|
24
|
-
|
25
|
-
RSpec.configure do |config|
|
26
|
-
config.include FactoryGirl::Syntax::Methods
|
27
|
-
end
|
28
|
-
|
29
|
-
def uuid
|
30
|
-
SecureRandom.uuid.to_s
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
+
|
3
|
+
require "rspec"
|
4
|
+
require 'factory_girl'
|
5
|
+
require 'pry'
|
6
|
+
|
7
|
+
factory_dir = File.join( File.dirname(__FILE__), 'factories/**/*.rb' )
|
8
|
+
Dir.glob( factory_dir ).each{|f| require(f); puts f }
|
9
|
+
|
10
|
+
require "quandl/client"
|
11
|
+
require "quandl/fabricate"
|
12
|
+
|
13
|
+
# Expects two env variables:
|
14
|
+
|
15
|
+
# administrator:
|
16
|
+
# ENV['QUANDL_AUTH_TOKEN']
|
17
|
+
|
18
|
+
# user:
|
19
|
+
# ENV['QUANDL_TEST_TOKEN']
|
20
|
+
|
21
|
+
include Quandl::Client
|
22
|
+
Quandl::Client.token = ENV['QUANDL_AUTH_TOKEN']
|
23
|
+
Quandl::Client.use ENV['QUANDL_TEST_URL']
|
24
|
+
|
25
|
+
RSpec.configure do |config|
|
26
|
+
config.include FactoryGirl::Syntax::Methods
|
27
|
+
end
|
28
|
+
|
29
|
+
def uuid
|
30
|
+
SecureRandom.uuid.to_s
|
31
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quandl_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: quandl_data
|
@@ -294,17 +294,39 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
294
294
|
- - ! '>='
|
295
295
|
- !ruby/object:Gem::Version
|
296
296
|
version: '0'
|
297
|
+
segments:
|
298
|
+
- 0
|
299
|
+
hash: -1694162574139276391
|
297
300
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
298
301
|
none: false
|
299
302
|
requirements:
|
300
303
|
- - ! '>='
|
301
304
|
- !ruby/object:Gem::Version
|
302
305
|
version: '0'
|
306
|
+
segments:
|
307
|
+
- 0
|
308
|
+
hash: -1694162574139276391
|
303
309
|
requirements: []
|
304
310
|
rubyforge_project:
|
305
|
-
rubygems_version: 1.8.
|
311
|
+
rubygems_version: 1.8.23
|
306
312
|
signing_key:
|
307
313
|
specification_version: 3
|
308
314
|
summary: Client rest orm.
|
309
|
-
test_files:
|
310
|
-
|
315
|
+
test_files:
|
316
|
+
- spec/factories/dataset.rb
|
317
|
+
- spec/factories/sheet.rb
|
318
|
+
- spec/factories/source.rb
|
319
|
+
- spec/fixtures/scraper.rb
|
320
|
+
- spec/lib/quandl/client/dataset/attributes_spec.rb
|
321
|
+
- spec/lib/quandl/client/dataset/data_spec.rb
|
322
|
+
- spec/lib/quandl/client/dataset/location_spec.rb
|
323
|
+
- spec/lib/quandl/client/dataset/persistence_spec.rb
|
324
|
+
- spec/lib/quandl/client/dataset/search_spec.rb
|
325
|
+
- spec/lib/quandl/client/dataset/source_spec.rb
|
326
|
+
- spec/lib/quandl/client/dataset/trim_spec.rb
|
327
|
+
- spec/lib/quandl/client/dataset/validation_spec.rb
|
328
|
+
- spec/lib/quandl/client/dataset_spec.rb
|
329
|
+
- spec/lib/quandl/client/scraper_spec.rb
|
330
|
+
- spec/lib/quandl/client/sheet_spec.rb
|
331
|
+
- spec/lib/quandl/client/source_spec.rb
|
332
|
+
- spec/spec_helper.rb
|