quandl_data 1.3.6 → 1.3.7
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 +4 -4
- data/UPGRADE.md +5 -0
- data/lib/quandl/data/cleaning.rb +0 -3
- data/lib/quandl/data/operations.rb +1 -1
- data/lib/quandl/data/version.rb +1 -1
- data/quandl_data.gemspec +2 -2
- data/spec/lib/quandl/data/frequency_spec.rb +41 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2765ee18f2f052db1ef9956677e302299b13a5d
|
4
|
+
data.tar.gz: 77ab4fb32cb5a87f1d713f6c65bf254edf8b7f0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 981fd1bc395580c46d88e2e9c3c5ac535cb27feee55132ada555e3f60d7d3ca1c1a3ba7bb8c18330750c1fca8fa266a51b446986fd43792a369f1d30f85051cd
|
7
|
+
data.tar.gz: 58f1063e28a89e3a20874faff1486421a59f337d96a9642cb7eef385d62c5fdac3dc34e9701cccfce6d7a964db9a438aa6cda5ef08b10a6f6be12c2421f6881b
|
data/UPGRADE.md
CHANGED
data/lib/quandl/data/cleaning.rb
CHANGED
@@ -29,9 +29,6 @@ module Cleaning
|
|
29
29
|
data = ensure_data_is_an_array(data)
|
30
30
|
# clean with either format or babelfish
|
31
31
|
known_format?( data ) ? clean_with_format(data) : clean_with_babelfish(data)
|
32
|
-
# rescue clean_with_format failure and try with babelfish
|
33
|
-
# rescue
|
34
|
-
# clean_with_babelfish(data)
|
35
32
|
end
|
36
33
|
|
37
34
|
def ensure_data_requires_cleaning(data)
|
@@ -128,7 +128,7 @@ module Operations
|
|
128
128
|
end
|
129
129
|
|
130
130
|
def frequency
|
131
|
-
@frequency ||= Quandl::
|
131
|
+
@frequency ||= Quandl::Babelfish.guess_frequency( data_array ).try(:to_sym)
|
132
132
|
end
|
133
133
|
def frequency=(value)
|
134
134
|
@frequency = value.to_sym if value.present?
|
data/lib/quandl/data/version.rb
CHANGED
data/quandl_data.gemspec
CHANGED
@@ -17,8 +17,8 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_runtime_dependency "quandl_operation", "~> 0.3.
|
21
|
-
s.add_runtime_dependency "quandl_babelfish", "~> 0.0"
|
20
|
+
s.add_runtime_dependency "quandl_operation", "~> 0.3.2"
|
21
|
+
s.add_runtime_dependency "quandl_babelfish", "~> 0.0.6"
|
22
22
|
|
23
23
|
s.add_development_dependency "rake", "~> 10.0"
|
24
24
|
s.add_development_dependency "rspec", "~> 2.13"
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Quandl::Data do
|
5
|
+
|
6
|
+
let(:table){ [] }
|
7
|
+
let(:data){ Quandl::Data.new(table) }
|
8
|
+
subject{ data }
|
9
|
+
|
10
|
+
its(:frequency){ should eq nil }
|
11
|
+
|
12
|
+
describe "#frequency" do
|
13
|
+
|
14
|
+
subject{ data.frequency }
|
15
|
+
|
16
|
+
{
|
17
|
+
daily: [['2012-01-01','1','2'],['2012-01-02','3','4'],['2012-01-03','5','6']],
|
18
|
+
monthly: [['2012-01-01','1','2'],['2012-02-01','3','4'],['2012-04-01','5','6'],['2012-04-01','1','2'],['2012-05-01','3','4'],['2012-06-01','5','6']],
|
19
|
+
quarterly: [['2012-01-01','1','2'],['2012-04-01','3','4'],['2012-07-01','5','6'],['2012-10-01','1','2'],['2013-01-01','3','4'],['2012-04-01','5','6']],
|
20
|
+
annual: [['2008-01-01','1','2'],['2008-12-01','3','4'],['2010-01-01','5','6'],['2011-01-01','1','2'],['2013-01-01','5','6']],
|
21
|
+
|
22
|
+
}.each do |freq, data|
|
23
|
+
context "given daily #{freq}" do
|
24
|
+
let(:table){ data }
|
25
|
+
it{ should eq freq }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context "given one row" do
|
30
|
+
let(:table){ [['2010-01-01','1','2']] }
|
31
|
+
it{ should eq :daily }
|
32
|
+
end
|
33
|
+
|
34
|
+
context "given nil" do
|
35
|
+
let(:table){ nil }
|
36
|
+
it{ should eq nil }
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quandl_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Hilscher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: quandl_operation
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.3.
|
19
|
+
version: 0.3.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.3.
|
26
|
+
version: 0.3.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: quandl_babelfish
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.0.6
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.0.6
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,6 +169,7 @@ files:
|
|
169
169
|
- spec/lib/fabricate/data_spec.rb
|
170
170
|
- spec/lib/quandl/data/enumerator_spec.rb
|
171
171
|
- spec/lib/quandl/data/format_spec.rb
|
172
|
+
- spec/lib/quandl/data/frequency_spec.rb
|
172
173
|
- spec/lib/quandl/data/operations_spec.rb
|
173
174
|
- spec/lib/quandl/data_spec.rb
|
174
175
|
- spec/spec_helper.rb
|
@@ -200,6 +201,7 @@ test_files:
|
|
200
201
|
- spec/lib/fabricate/data_spec.rb
|
201
202
|
- spec/lib/quandl/data/enumerator_spec.rb
|
202
203
|
- spec/lib/quandl/data/format_spec.rb
|
204
|
+
- spec/lib/quandl/data/frequency_spec.rb
|
203
205
|
- spec/lib/quandl/data/operations_spec.rb
|
204
206
|
- spec/lib/quandl/data_spec.rb
|
205
207
|
- spec/spec_helper.rb
|