quandl_client 2.7.5 → 2.7.6

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