quandl_data 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cdd94ea8c220f54cd5202d5e1268064036ef9dd0
|
4
|
+
data.tar.gz: 90a0d0c2de64ca3c1c694eae1e213e5494ca31a5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5c0fc8b94f889367e0cff624bd486821deee4f24ee5734c77c4db33a46c6015b8f791740d475f031e50bc2594e3f3d10c9e82a82de4aa5655839297e63120ed8
|
7
|
+
data.tar.gz: 7eff10e50e442c25ebe1806eeb3e3828547031a59ed1fd4bdb18f939aa9e97d779d9ac54ca8e7a8217cd3a56c4dcf820df542dcd4ad09e66c46d16202ce63532
|
data/lib/quandl/data/version.rb
CHANGED
data/lib/quandl/fabricate.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Quandl::Data::Enumerator do
|
5
|
+
|
6
|
+
let(:data){ Quandl::Fabricate::Data.rand( nils: false, rows: 4, columns: 4 ) }
|
7
|
+
subject { data }
|
8
|
+
|
9
|
+
its(:to_h){ should be_a Hash }
|
10
|
+
its(:count){ should eq 4 }
|
11
|
+
|
12
|
+
describe "#==" do
|
13
|
+
it{ should eq data.data_array }
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -1,13 +1,22 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
|
-
describe Quandl::Data do
|
4
|
+
describe Quandl::Data::Operations do
|
5
|
+
|
5
6
|
let(:data){ Quandl::Fabricate::Data.rand( nils: false, rows: 4, columns: 4 ) }
|
6
7
|
subject { data }
|
7
8
|
|
8
9
|
its(:to_h){ should be_a Hash }
|
9
10
|
its(:count){ should eq 4 }
|
10
11
|
|
12
|
+
it "should parse csv" do
|
13
|
+
Quandl::Data.new(subject.to_csv).count.should eq 4
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should limit the data" do
|
17
|
+
subject.limit(2).count.should eq 2
|
18
|
+
end
|
19
|
+
|
11
20
|
describe "#collapse=" do
|
12
21
|
|
13
22
|
it "should collapse to monthly" do
|
@@ -21,10 +30,6 @@ describe Quandl::Data do
|
|
21
30
|
|
22
31
|
end
|
23
32
|
|
24
|
-
it "should parse csv" do
|
25
|
-
Quandl::Data.new(subject.to_csv).count.should eq 4
|
26
|
-
end
|
27
|
-
|
28
33
|
it "should convert to julian dates" do
|
29
34
|
data = subject.to_jd
|
30
35
|
data[0][0].should be_a Integer
|
@@ -57,27 +62,8 @@ describe Quandl::Data do
|
|
57
62
|
data.transform(:cumul).should eq [[1000, 10], [1001, 30], [1002, 60]]
|
58
63
|
end
|
59
64
|
end
|
60
|
-
|
61
|
-
it "should limit the data" do
|
62
|
-
subject.limit(2).count.should eq 2
|
63
|
-
end
|
64
65
|
|
65
|
-
describe "
|
66
|
-
|
67
|
-
its(:to_csv){ should be_a String }
|
68
|
-
|
69
|
-
it "should output csv that is consistent with subject" do
|
70
|
-
data = CSV.parse( subject.to_csv ).collect{|r| r.collect{|v| v.to_f } }
|
71
|
-
data.should eq subject
|
72
|
-
end
|
73
|
-
|
74
|
-
it "should output csv when initialized with a Quandl::Data" do
|
75
|
-
Quandl::Data.new( subject ).to_csv.should eq subject.to_csv
|
76
|
-
end
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
describe "to_date" do
|
66
|
+
describe "#to_date" do
|
81
67
|
|
82
68
|
it "should convert julian dates to dates" do
|
83
69
|
subject.to_date.first.first.should be_a Date
|
@@ -85,19 +71,19 @@ describe Quandl::Data do
|
|
85
71
|
|
86
72
|
end
|
87
73
|
|
88
|
-
describe "to_json" do
|
74
|
+
describe "#to_json" do
|
89
75
|
it "should convert the data_array to json and back" do
|
90
76
|
JSON.parse(subject.to_json).should eq JSON.parse(subject.data_array.to_json)
|
91
77
|
end
|
92
78
|
end
|
93
79
|
|
94
|
-
describe "as_json" do
|
80
|
+
describe "#as_json" do
|
95
81
|
it "should be a representation of data_array" do
|
96
82
|
subject.as_json.should eq subject.data_array
|
97
83
|
end
|
98
84
|
end
|
99
85
|
|
100
|
-
describe "trim_end" do
|
86
|
+
describe "#trim_end" do
|
101
87
|
|
102
88
|
it "should delete everything after trim_end" do
|
103
89
|
data = Quandl::Fabricate::Data.rand( nils: false, rows: 10, columns: 1 ).sort_descending
|
@@ -123,7 +109,7 @@ describe Quandl::Data do
|
|
123
109
|
|
124
110
|
end
|
125
111
|
|
126
|
-
describe "trim_start" do
|
112
|
+
describe "#trim_start" do
|
127
113
|
|
128
114
|
it "should delete everything before trim_start" do
|
129
115
|
data = Quandl::Fabricate::Data.rand( nils: false, rows: 10, columns: 1 ).sort_descending
|
@@ -147,4 +133,19 @@ describe Quandl::Data do
|
|
147
133
|
|
148
134
|
end
|
149
135
|
|
136
|
+
describe "#to_csv" do
|
137
|
+
|
138
|
+
its(:to_csv){ should be_a String }
|
139
|
+
|
140
|
+
it "should output csv that is consistent with subject" do
|
141
|
+
data = CSV.parse( subject.to_csv ).collect{|r| r.collect{|v| v.to_f } }
|
142
|
+
data.should eq subject
|
143
|
+
end
|
144
|
+
|
145
|
+
it "should output csv when initialized with a Quandl::Data" do
|
146
|
+
Quandl::Data.new( subject ).to_csv.should eq subject.to_csv
|
147
|
+
end
|
148
|
+
|
149
|
+
end
|
150
|
+
|
150
151
|
end
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quandl_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Blake Hilscher
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-11-12 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: fivemat
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: pry
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - '>='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - '>='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: activesupport
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - '>='
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - '>='
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -94,7 +83,6 @@ dependencies:
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: quandl_logger
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - ~>
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,7 +90,6 @@ dependencies:
|
|
102
90
|
type: :runtime
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - ~>
|
108
95
|
- !ruby/object:Gem::Version
|
@@ -110,7 +97,6 @@ dependencies:
|
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: quandl_operation
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
101
|
- - ~>
|
116
102
|
- !ruby/object:Gem::Version
|
@@ -118,7 +104,6 @@ dependencies:
|
|
118
104
|
type: :runtime
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
108
|
- - ~>
|
124
109
|
- !ruby/object:Gem::Version
|
@@ -148,34 +133,35 @@ files:
|
|
148
133
|
- lib/quandl/fabricate/data.rb
|
149
134
|
- quandl_data.gemspec
|
150
135
|
- spec/lib/fabricate/data_spec.rb
|
151
|
-
- spec/lib/quandl/
|
136
|
+
- spec/lib/quandl/data/enumerator_spec.rb
|
137
|
+
- spec/lib/quandl/data/operations_spec.rb
|
152
138
|
- spec/spec_helper.rb
|
153
139
|
homepage: http://blake.hilscher.ca/
|
154
140
|
licenses:
|
155
141
|
- MIT
|
142
|
+
metadata: {}
|
156
143
|
post_install_message:
|
157
144
|
rdoc_options: []
|
158
145
|
require_paths:
|
159
146
|
- lib
|
160
147
|
required_ruby_version: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
148
|
requirements:
|
163
149
|
- - '>='
|
164
150
|
- !ruby/object:Gem::Version
|
165
151
|
version: '0'
|
166
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
|
-
none: false
|
168
153
|
requirements:
|
169
154
|
- - '>='
|
170
155
|
- !ruby/object:Gem::Version
|
171
156
|
version: '0'
|
172
157
|
requirements: []
|
173
158
|
rubyforge_project:
|
174
|
-
rubygems_version: 1.
|
159
|
+
rubygems_version: 2.1.10
|
175
160
|
signing_key:
|
176
|
-
specification_version:
|
161
|
+
specification_version: 4
|
177
162
|
summary: For interfacing with data
|
178
163
|
test_files:
|
179
164
|
- spec/lib/fabricate/data_spec.rb
|
180
|
-
- spec/lib/quandl/
|
165
|
+
- spec/lib/quandl/data/enumerator_spec.rb
|
166
|
+
- spec/lib/quandl/data/operations_spec.rb
|
181
167
|
- spec/spec_helper.rb
|