quandl_client 2.7.3 → 2.7.4

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