quandl_client 2.7.9 → 2.7.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/.gitignore +7 -7
  2. data/.rspec +1 -1
  3. data/.travis.yml +20 -20
  4. data/.yardopts +2 -2
  5. data/Gemfile +12 -12
  6. data/Guardfile +8 -8
  7. data/LICENSE +7 -7
  8. data/README.md +303 -303
  9. data/Rakefile +31 -31
  10. data/UPGRADE.md +214 -210
  11. data/VERSION +1 -1
  12. data/examples/create.rb +32 -32
  13. data/examples/find.rb +17 -17
  14. data/examples/login.rb +12 -12
  15. data/examples/search.rb +12 -12
  16. data/examples/trims.rb +15 -15
  17. data/lib/quandl/client.rb +53 -49
  18. data/lib/quandl/client/base.rb +91 -91
  19. data/lib/quandl/client/base/attributes.rb +15 -15
  20. data/lib/quandl/client/base/model.rb +40 -40
  21. data/lib/quandl/client/base/search.rb +74 -74
  22. data/lib/quandl/client/base/validation.rb +101 -101
  23. data/lib/quandl/client/middleware.rb +9 -9
  24. data/lib/quandl/client/middleware/parse_json.rb +85 -85
  25. data/lib/quandl/client/models/dataset.rb +269 -269
  26. data/lib/quandl/client/models/dataset/data.rb +57 -57
  27. data/lib/quandl/client/models/location.rb +10 -10
  28. data/lib/quandl/client/models/report.rb +14 -14
  29. data/lib/quandl/client/models/scraper.rb +16 -16
  30. data/lib/quandl/client/models/sheet.rb +50 -50
  31. data/lib/quandl/client/models/source.rb +48 -48
  32. data/lib/quandl/client/models/superset.rb +65 -65
  33. data/lib/quandl/client/models/user.rb +7 -7
  34. data/lib/quandl/client/version.rb +14 -14
  35. data/lib/quandl/her/remove_method_data.rb +8 -8
  36. data/lib/quandl/pattern.rb +37 -37
  37. data/lib/quandl/pattern/client.rb +8 -8
  38. data/quandl_client.gemspec +33 -33
  39. data/spec/factories/dataset.rb +10 -10
  40. data/spec/factories/sheet.rb +7 -7
  41. data/spec/factories/source.rb +9 -9
  42. data/spec/fixtures/scraper.rb +5 -5
  43. data/spec/lib/quandl/client/dataset/attributes_spec.rb +63 -63
  44. data/spec/lib/quandl/client/dataset/data_spec.rb +92 -92
  45. data/spec/lib/quandl/client/dataset/location_spec.rb +65 -65
  46. data/spec/lib/quandl/client/dataset/persistence_spec.rb +104 -104
  47. data/spec/lib/quandl/client/dataset/search_spec.rb +19 -19
  48. data/spec/lib/quandl/client/dataset/source_spec.rb +47 -47
  49. data/spec/lib/quandl/client/dataset/trim_spec.rb +35 -35
  50. data/spec/lib/quandl/client/dataset/validation_spec.rb +68 -68
  51. data/spec/lib/quandl/client/dataset_spec.rb +57 -57
  52. data/spec/lib/quandl/client/scraper_spec.rb +71 -71
  53. data/spec/lib/quandl/client/sheet_spec.rb +37 -37
  54. data/spec/lib/quandl/client/source_spec.rb +51 -51
  55. data/spec/spec_helper.rb +30 -30
  56. metadata +4 -27
data/Rakefile CHANGED
@@ -1,31 +1,31 @@
1
- require "bundler"
2
- require "rake"
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
- $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
6
-
7
- require 'pry'
8
- require "quandl/client"
9
-
10
- include Quandl::Client
11
-
12
- config = OpenStruct.new(YAML.load(File.read("#{ENV['HOME']}/.quandl/config")))
13
-
14
- Quandl::Client.use config.quandl_url
15
- Quandl::Client.token = config.token
16
-
17
- task :default => :spec
18
-
19
- desc "Run all specs"
20
- RSpec::Core::RakeTask.new(:spec) do |task|
21
- task.pattern = "spec/**/*_spec.rb"
22
- end
23
-
24
- require 'quandl/utility/rake_tasks'
25
- Quandl::Utility::Tasks.configure do |c|
26
- c.name = 'quandl'
27
- c.tag_prefix = 'v'
28
- c.version_path = 'VERSION'
29
- c.changelog_path = 'UPGRADE.md'
30
- c.changelog_matching = ['^QUGC','^WIKI']
31
- end
1
+ require "bundler"
2
+ require "rake"
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
6
+
7
+ require 'pry'
8
+ require "quandl/client"
9
+
10
+ include Quandl::Client
11
+
12
+ config = OpenStruct.new(YAML.load(File.read("#{ENV['HOME']}/.quandl/config")))
13
+
14
+ Quandl::Client.use config.quandl_url
15
+ Quandl::Client.token = config.token
16
+
17
+ task :default => :spec
18
+
19
+ desc "Run all specs"
20
+ RSpec::Core::RakeTask.new(:spec) do |task|
21
+ task.pattern = "spec/**/*_spec.rb"
22
+ end
23
+
24
+ require 'quandl/utility/rake_tasks'
25
+ Quandl::Utility::Tasks.configure do |c|
26
+ c.name = 'quandl'
27
+ c.tag_prefix = 'v'
28
+ c.version_path = 'VERSION'
29
+ c.changelog_path = 'UPGRADE.md'
30
+ c.changelog_matching = ['^QUGC','^WIKI']
31
+ end
data/UPGRADE.md CHANGED
@@ -1,211 +1,215 @@
1
- ## 2.7.9
2
-
3
- * QUGC-164 also search by code
4
- * QUGC-164 find by id or source_code/code, or build
5
- * QUGC-164 attributes slice needs to ensure that keys are symbols
6
-
7
-
8
-
9
- ## 2.7.8
10
-
11
-
12
-
13
-
14
-
15
- ## 2.7.7
16
-
17
-
18
-
19
-
20
-
21
- ## 2.7.6
22
-
23
- * QUGC-140 if a source_code is given but does not exist, it should warn the user
24
-
25
-
26
-
27
- ## 2.7.5
28
- add 'at' option for scraper scheduling
29
-
30
- ## 2.7.4
31
- full url bug fixed when "api" has no / at the end
32
-
33
-
34
- ## 2.6.2
35
-
36
- * QUGC-55 Add Report for filing reports
37
-
38
-
39
-
40
- ## 2.6.1
41
-
42
- * QUGC-113 fix Dataset#data errors dont propagate to parent object
43
- * QUGC-113 Write failing specs for Dataset#data errors dont propagate to parent object
44
-
45
-
46
-
47
- ## 2.6.0
48
-
49
- * QUGC-104 Fixes when upload fails output is not json
50
- * QUGC-103 Fixes quandl upload test -F json does not include metadata
51
-
52
-
53
-
54
- ## 2.5.2
55
-
56
- * WIKI-153 Add scrapers
57
-
58
-
59
- ## 2.5.1
60
-
61
- * QUGC-57 move data validation from Quandl::Format into Quandl::Client. Data validations only run on #valid?
62
- * QUGC-53 numeric codes require the full code
63
-
64
-
65
- ## 2.5.0
66
-
67
- * remove yajl
68
-
69
-
70
- ## 2.4.9
71
-
72
- * observe ruby platform
73
-
74
-
75
- ## 2.4.7
76
-
77
- * add middleware to track the origin of requests across quandl packages
78
-
79
-
80
- ## 2.4.6
81
-
82
- * QUGC-43 improved message on wrong number of colums
83
- * QUGC-41 enforce code formatting. always upcase codes
84
- * improved example of valid code
85
- * revise code pattern
86
-
87
-
88
- ## 2.4.5
89
-
90
- * QUGC-40 add validation to enforce: You may not change number of columns in a dataset
91
- * QUGC-37 Dataest.find accept backslash or forward slash interchangeably
92
-
93
-
94
- ## 2.4.4
95
-
96
- * Dataset#data to_table assigns column_names to headers
97
- * add skip_browse to Sheet
98
-
99
-
100
- ## 2.4.3
101
-
102
- * hotfix for full_code pattern matching ... code can be as short as two characters
103
-
104
-
105
- ## 2.4.2
106
-
107
- * Dataset.find will return nil unless the id is an integer, or matches the quandl pattern for full_code
108
-
109
-
110
- ## 2.4.1
111
-
112
- * revise reference_url http prepend
113
-
114
-
115
- ## 2.4.0
116
-
117
- * Dataset#reference_url should prepend of http:// when missing
118
- * add Quandl::Pattern for defining regex patterns with embedded examples
119
-
120
-
121
- # 2.3.2
122
-
123
- * add #elapsed_request_time_ms
124
- * refactor save_time to request_time. Add specs to #destroy for request_started_at, finished_at, elapsed_request_time
125
- * add Client::Base#save_started_at, #save_finished_at, #elapsed_save_time. before_save :touch_save_started_at, after_save :touch_save_finished_at
126
-
127
-
128
- ## 2.3.1
129
-
130
- * bump quandl_data
131
- * add human_error_messsages
132
-
133
-
134
- ## 2.3.0
135
-
136
- * add auth_token attribute to user
137
- * add Quandl::Client::User, .login for authenticating
138
- * full_url outputs the quandl link instead of the api link. Add human_status and HTTP_STATUS_CODES
139
- * should validate display_url as a url
140
- * add reference_url alias for display_url. reference_url will automatically add http when missing
141
-
142
-
143
- ## 2.2.1
144
-
145
- * full_code: dont assume that source_code is present
146
- * Dataset#data scope is cached to permit building across multiple lines. add Dataset#reload to wipe data_scope, dataset_data
147
-
148
-
149
- ## 2.2.0
150
-
151
- * add specs for Dataset.query
152
- * Dataset.query.all.metadata should pass
153
-
154
-
155
- ## 2.1.4
156
-
157
- * add specs for Dataset.query(term).all; make specs pass
158
-
159
-
160
-
161
- ## 2.1.3
162
-
163
- * add specs for data scopes
164
- * fix failing data scope specs
165
-
166
-
167
- ## 2.1.2
168
-
169
- * bump quandl_data, operation, logger
170
-
171
-
172
- ## 2.0.1
173
-
174
- * fully qualified classes to avoid collisions
175
-
176
- ## 2.0.0
177
-
178
- * update client to take advantage of new /api/v2 routes
179
-
180
- ## 0.1.17
181
-
182
- * Dataset#source_code is optional
183
-
184
-
185
- ## 0.1.16
186
-
187
- * add sheet description
188
-
189
- ## 0.1.15
190
-
191
- * revise parse_json to respond with more informative error
192
- * validation errors should return 422
193
-
194
- ## 0.1.14
195
-
196
- * add Dataset#locations spec to test that location data is returned in the same order as it is sent.
197
-
198
- ## 0.1.12
199
-
200
- * fix undefined error method
201
-
202
- ## 0.1.11
203
-
204
- * add spec for Dataset#availability_delay
205
- * add present?, exists?, blank? that check against response status.
206
- * remove erroneous source_code and code validations.
207
-
208
-
209
- ## 0.1.10
210
-
1
+ ## 2.7.10
2
+ * QUGC-168 can pass request_platform
3
+
4
+
5
+ ## 2.7.9
6
+
7
+ * QUGC-164 also search by code
8
+ * QUGC-164 find by id or source_code/code, or build
9
+ * QUGC-164 attributes slice needs to ensure that keys are symbols
10
+
11
+
12
+
13
+ ## 2.7.8
14
+
15
+
16
+
17
+
18
+
19
+ ## 2.7.7
20
+
21
+
22
+
23
+
24
+
25
+ ## 2.7.6
26
+
27
+ * QUGC-140 if a source_code is given but does not exist, it should warn the user
28
+
29
+
30
+
31
+ ## 2.7.5
32
+ add 'at' option for scraper scheduling
33
+
34
+ ## 2.7.4
35
+ full url bug fixed when "api" has no / at the end
36
+
37
+
38
+ ## 2.6.2
39
+
40
+ * QUGC-55 Add Report for filing reports
41
+
42
+
43
+
44
+ ## 2.6.1
45
+
46
+ * QUGC-113 fix Dataset#data errors dont propagate to parent object
47
+ * QUGC-113 Write failing specs for Dataset#data errors dont propagate to parent object
48
+
49
+
50
+
51
+ ## 2.6.0
52
+
53
+ * QUGC-104 Fixes when upload fails output is not json
54
+ * QUGC-103 Fixes quandl upload test -F json does not include metadata
55
+
56
+
57
+
58
+ ## 2.5.2
59
+
60
+ * WIKI-153 Add scrapers
61
+
62
+
63
+ ## 2.5.1
64
+
65
+ * QUGC-57 move data validation from Quandl::Format into Quandl::Client. Data validations only run on #valid?
66
+ * QUGC-53 numeric codes require the full code
67
+
68
+
69
+ ## 2.5.0
70
+
71
+ * remove yajl
72
+
73
+
74
+ ## 2.4.9
75
+
76
+ * observe ruby platform
77
+
78
+
79
+ ## 2.4.7
80
+
81
+ * add middleware to track the origin of requests across quandl packages
82
+
83
+
84
+ ## 2.4.6
85
+
86
+ * QUGC-43 improved message on wrong number of colums
87
+ * QUGC-41 enforce code formatting. always upcase codes
88
+ * improved example of valid code
89
+ * revise code pattern
90
+
91
+
92
+ ## 2.4.5
93
+
94
+ * QUGC-40 add validation to enforce: You may not change number of columns in a dataset
95
+ * QUGC-37 Dataest.find accept backslash or forward slash interchangeably
96
+
97
+
98
+ ## 2.4.4
99
+
100
+ * Dataset#data to_table assigns column_names to headers
101
+ * add skip_browse to Sheet
102
+
103
+
104
+ ## 2.4.3
105
+
106
+ * hotfix for full_code pattern matching ... code can be as short as two characters
107
+
108
+
109
+ ## 2.4.2
110
+
111
+ * Dataset.find will return nil unless the id is an integer, or matches the quandl pattern for full_code
112
+
113
+
114
+ ## 2.4.1
115
+
116
+ * revise reference_url http prepend
117
+
118
+
119
+ ## 2.4.0
120
+
121
+ * Dataset#reference_url should prepend of http:// when missing
122
+ * add Quandl::Pattern for defining regex patterns with embedded examples
123
+
124
+
125
+ # 2.3.2
126
+
127
+ * add #elapsed_request_time_ms
128
+ * refactor save_time to request_time. Add specs to #destroy for request_started_at, finished_at, elapsed_request_time
129
+ * add Client::Base#save_started_at, #save_finished_at, #elapsed_save_time. before_save :touch_save_started_at, after_save :touch_save_finished_at
130
+
131
+
132
+ ## 2.3.1
133
+
134
+ * bump quandl_data
135
+ * add human_error_messsages
136
+
137
+
138
+ ## 2.3.0
139
+
140
+ * add auth_token attribute to user
141
+ * add Quandl::Client::User, .login for authenticating
142
+ * full_url outputs the quandl link instead of the api link. Add human_status and HTTP_STATUS_CODES
143
+ * should validate display_url as a url
144
+ * add reference_url alias for display_url. reference_url will automatically add http when missing
145
+
146
+
147
+ ## 2.2.1
148
+
149
+ * full_code: dont assume that source_code is present
150
+ * Dataset#data scope is cached to permit building across multiple lines. add Dataset#reload to wipe data_scope, dataset_data
151
+
152
+
153
+ ## 2.2.0
154
+
155
+ * add specs for Dataset.query
156
+ * Dataset.query.all.metadata should pass
157
+
158
+
159
+ ## 2.1.4
160
+
161
+ * add specs for Dataset.query(term).all; make specs pass
162
+
163
+
164
+
165
+ ## 2.1.3
166
+
167
+ * add specs for data scopes
168
+ * fix failing data scope specs
169
+
170
+
171
+ ## 2.1.2
172
+
173
+ * bump quandl_data, operation, logger
174
+
175
+
176
+ ## 2.0.1
177
+
178
+ * fully qualified classes to avoid collisions
179
+
180
+ ## 2.0.0
181
+
182
+ * update client to take advantage of new /api/v2 routes
183
+
184
+ ## 0.1.17
185
+
186
+ * Dataset#source_code is optional
187
+
188
+
189
+ ## 0.1.16
190
+
191
+ * add sheet description
192
+
193
+ ## 0.1.15
194
+
195
+ * revise parse_json to respond with more informative error
196
+ * validation errors should return 422
197
+
198
+ ## 0.1.14
199
+
200
+ * add Dataset#locations spec to test that location data is returned in the same order as it is sent.
201
+
202
+ ## 0.1.12
203
+
204
+ * fix undefined error method
205
+
206
+ ## 0.1.11
207
+
208
+ * add spec for Dataset#availability_delay
209
+ * add present?, exists?, blank? that check against response status.
210
+ * remove erroneous source_code and code validations.
211
+
212
+
213
+ ## 0.1.10
214
+
211
215
  * Add Dataset#availability_delay