quandl_format 0.1.6 → 0.1.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/format/dataset/load.rb +1 -1
- data/lib/quandl/format/version.rb +1 -1
- data/spec/fixtures/data/tabular.qdf +8 -0
- data/spec/lib/quandl/format/dataset/{errors_spec.rb → load/errors_spec.rb} +3 -3
- data/spec/lib/quandl/format/dataset/{valid_data_spec.rb → load/valid_spec.rb} +18 -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: 5f454dd17f3f3d71afa6ecda800df054fcc52f27
|
4
|
+
data.tar.gz: 04b4dab5f31e57b2f7c6e6af810e952fe25524ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75af0ccda893f85cc46719d1fadf2ddfa65b6abef92075ecddcc098ba4f7c1ed7ea1ba5b031223f523921293639b5d313ace67ec55a28bf0c132bad20f11d78e
|
7
|
+
data.tar.gz: cb56897d0c1ec4b625708a85917ecc88efba46d6576d4576812679822b466d436736542944890303d44741f1f04f502da709adce8ecbcff45b0a9509326b8a2f
|
data/UPGRADE.md
CHANGED
@@ -60,7 +60,7 @@ class Quandl::Format::Dataset::Load
|
|
60
60
|
# we cant continue unless attributes are present
|
61
61
|
next if node[:attributes].blank?
|
62
62
|
# parse data as csv
|
63
|
-
node[:attributes][:data] =
|
63
|
+
node[:attributes][:data] = Quandl::Data::Format.csv_to_array(node[:data])
|
64
64
|
# onwards
|
65
65
|
output << node
|
66
66
|
end
|
@@ -5,11 +5,11 @@ describe Quandl::Format::Dataset do
|
|
5
5
|
expected_errors = [
|
6
6
|
{ file: 'invalid_data', error: /Date/ },
|
7
7
|
{ file: 'unknown_attribute', error: /this_attribute_does_not_exist/ },
|
8
|
-
{ file: 'mismatched_columns', error: /
|
9
|
-
{ file: 'mismatched_rows', error: /
|
8
|
+
{ file: 'mismatched_columns', error: /Expected 4 but found 5/ },
|
9
|
+
{ file: 'mismatched_rows', error: /Expected 3 but found 4/ },
|
10
10
|
{ file: 'invalid_yaml', error: /could not find expected ':'/ },
|
11
11
|
{ file: 'missing_dashes', error: /Attribute parse error at line 6 column 1/ },
|
12
|
-
{ file: 'missing_dashes', error: /
|
12
|
+
{ file: 'missing_dashes', error: /Did you forget to delimit the meta data section/ },
|
13
13
|
]
|
14
14
|
# run each expectation
|
15
15
|
expected_errors.each do |pair|
|
@@ -40,4 +40,22 @@ describe Quandl::Format::Dataset do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
+
context "tabular.qdf" do
|
44
|
+
let(:data){ Quandl::Format::Dataset.load( fixtures_data['tabular'] ) }
|
45
|
+
|
46
|
+
it{ should be_a Array }
|
47
|
+
its(:count){ should eq 1 }
|
48
|
+
|
49
|
+
describe "#first" do
|
50
|
+
subject{ data.first }
|
51
|
+
its(:code){ should eq 'TABULAR' }
|
52
|
+
its(:column_names){ should eq ['Date','First','Second','Third','Fourth']}
|
53
|
+
its(:data){ should eq [
|
54
|
+
[Date.parse('2013-12-31'),10.0,20.0,30.0,40.0],
|
55
|
+
[Date.parse('2012-12-31'),20.0,30.0,40.0,50.0],
|
56
|
+
[Date.parse('2011-12-31'),30.0,40.0,50.0,60.0],
|
57
|
+
]}
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
43
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quandl_format
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.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: 2013-12-
|
11
|
+
date: 2013-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -170,15 +170,16 @@ files:
|
|
170
170
|
- spec/fixtures/data/mismatched_columns.qdf
|
171
171
|
- spec/fixtures/data/mismatched_rows.qdf
|
172
172
|
- spec/fixtures/data/missing_dashes.qdf
|
173
|
+
- spec/fixtures/data/tabular.qdf
|
173
174
|
- spec/fixtures/data/unknown_attribute.qdf
|
174
175
|
- spec/fixtures/data/valid.qdf
|
175
176
|
- spec/fixtures/format.rb
|
176
177
|
- spec/lib/quandl/client/dataset_spec.rb
|
177
178
|
- spec/lib/quandl/format/dataset/attributes_spec.rb
|
178
179
|
- spec/lib/quandl/format/dataset/client_spec.rb
|
179
|
-
- spec/lib/quandl/format/dataset/errors_spec.rb
|
180
|
+
- spec/lib/quandl/format/dataset/load/errors_spec.rb
|
181
|
+
- spec/lib/quandl/format/dataset/load/valid_spec.rb
|
180
182
|
- spec/lib/quandl/format/dataset/load_spec.rb
|
181
|
-
- spec/lib/quandl/format/dataset/valid_data_spec.rb
|
182
183
|
- spec/lib/quandl/format/dataset_spec.rb
|
183
184
|
- spec/spec_helper.rb
|
184
185
|
homepage: http://blake.hilscher.ca/
|
@@ -214,14 +215,15 @@ test_files:
|
|
214
215
|
- spec/fixtures/data/mismatched_columns.qdf
|
215
216
|
- spec/fixtures/data/mismatched_rows.qdf
|
216
217
|
- spec/fixtures/data/missing_dashes.qdf
|
218
|
+
- spec/fixtures/data/tabular.qdf
|
217
219
|
- spec/fixtures/data/unknown_attribute.qdf
|
218
220
|
- spec/fixtures/data/valid.qdf
|
219
221
|
- spec/fixtures/format.rb
|
220
222
|
- spec/lib/quandl/client/dataset_spec.rb
|
221
223
|
- spec/lib/quandl/format/dataset/attributes_spec.rb
|
222
224
|
- spec/lib/quandl/format/dataset/client_spec.rb
|
223
|
-
- spec/lib/quandl/format/dataset/errors_spec.rb
|
225
|
+
- spec/lib/quandl/format/dataset/load/errors_spec.rb
|
226
|
+
- spec/lib/quandl/format/dataset/load/valid_spec.rb
|
224
227
|
- spec/lib/quandl/format/dataset/load_spec.rb
|
225
|
-
- spec/lib/quandl/format/dataset/valid_data_spec.rb
|
226
228
|
- spec/lib/quandl/format/dataset_spec.rb
|
227
229
|
- spec/spec_helper.rb
|