reuters 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +23 -0
  3. data/.rubocop.enabled.yml +23 -0
  4. data/.rubocop.yml +15 -0
  5. data/.ruby-gemset +1 -0
  6. data/.ruby-version +1 -0
  7. data/.travis.yml +28 -0
  8. data/CONTRIBUTING.md +37 -0
  9. data/Gemfile +4 -0
  10. data/LICENSE.txt +22 -0
  11. data/README.md +209 -0
  12. data/Rakefile +5 -0
  13. data/lib/reuters.rb +98 -0
  14. data/lib/reuters/builder.rb +117 -0
  15. data/lib/reuters/client.rb +12 -0
  16. data/lib/reuters/client/base.rb +132 -0
  17. data/lib/reuters/client/fundamentals.rb +20 -0
  18. data/lib/reuters/client/search.rb +19 -0
  19. data/lib/reuters/client/search/base.rb +26 -0
  20. data/lib/reuters/client/search/equity.rb +64 -0
  21. data/lib/reuters/client/token.rb +101 -0
  22. data/lib/reuters/credentials.rb +79 -0
  23. data/lib/reuters/namespaces.rb +25 -0
  24. data/lib/reuters/namespaces/base.rb +47 -0
  25. data/lib/reuters/namespaces/common.rb +30 -0
  26. data/lib/reuters/namespaces/fundamentals.rb +31 -0
  27. data/lib/reuters/namespaces/search.rb +48 -0
  28. data/lib/reuters/namespaces/search/equity.rb +32 -0
  29. data/lib/reuters/namespaces/token.rb +30 -0
  30. data/lib/reuters/response.rb +32 -0
  31. data/lib/reuters/version.rb +6 -0
  32. data/lib/reuters/wsdls.rb +25 -0
  33. data/lib/reuters/wsdls/base.rb +44 -0
  34. data/lib/reuters/wsdls/fundamentals.rb +21 -0
  35. data/lib/reuters/wsdls/search.rb +13 -0
  36. data/lib/reuters/wsdls/search/equity.rb +25 -0
  37. data/lib/reuters/wsdls/token.rb +22 -0
  38. data/reuters.gemspec +41 -0
  39. data/spec/fixtures/responses/token.xml +11 -0
  40. data/spec/reuters/builder_spec.rb +189 -0
  41. data/spec/reuters/client/fundamentals_spec.rb +11 -0
  42. data/spec/reuters/client/search/equity_spec.rb +46 -0
  43. data/spec/reuters/client/token_spec.rb +91 -0
  44. data/spec/reuters/client_spec.rb +0 -0
  45. data/spec/reuters/credentials_spec.rb +68 -0
  46. data/spec/reuters/namespaces/common_spec.rb +5 -0
  47. data/spec/reuters/namespaces/fundamentals_spec.rb +5 -0
  48. data/spec/reuters/namespaces/search/equity_spec.rb +5 -0
  49. data/spec/reuters/namespaces/search_spec.rb +31 -0
  50. data/spec/reuters/namespaces/token_spec.rb +5 -0
  51. data/spec/reuters/namespaces_spec.rb +31 -0
  52. data/spec/reuters/response_spec.rb +54 -0
  53. data/spec/reuters/version_spec.rb +9 -0
  54. data/spec/reuters/wsdls/fundamentals_spec.rb +5 -0
  55. data/spec/reuters/wsdls/search/equity_spec.rb +5 -0
  56. data/spec/reuters/wsdls/token_spec.rb +5 -0
  57. data/spec/reuters/wsdls_spec.rb +31 -0
  58. data/spec/reuters_spec.rb +10 -0
  59. data/spec/spec_helper.rb +17 -0
  60. data/spec/support/client/search_shared.rb +5 -0
  61. data/spec/support/client_shared.rb +70 -0
  62. data/spec/support/configurable_shared.rb +9 -0
  63. data/spec/support/namespaces_actions_shared.rb +36 -0
  64. data/spec/support/namespaces_shared.rb +42 -0
  65. data/spec/support/wsdls_actions_shared.rb +36 -0
  66. data/spec/support/wsdls_shared.rb +53 -0
  67. metadata +333 -0
@@ -0,0 +1,42 @@
1
+ shared_examples "a namespace module" do
2
+
3
+ it { should respond_to(:name) }
4
+ it { should respond_to(:name=) }
5
+ it { should respond_to(:year) }
6
+ it { should respond_to(:year=) }
7
+ it { should respond_to(:month) }
8
+ it { should respond_to(:month=) }
9
+ it { should respond_to(:day) }
10
+ it { should respond_to(:day=) }
11
+ it { should respond_to(:endpoint) }
12
+ it { should respond_to(:configure) }
13
+
14
+ it_behaves_like "a configurable class"
15
+
16
+ describe "return value of #endpoint" do
17
+
18
+ before { @endpoint = subject.endpoint }
19
+
20
+ it "should resolve the endpoint name" do
21
+ expect(@endpoint).to include(Reuters.namespaces_endpoint)
22
+ end
23
+
24
+ it "should contain the year" do
25
+ expect(@endpoint).to include(subject.year)
26
+ end
27
+
28
+ it "should contain the month" do
29
+ expect(@endpoint).to include(subject.month)
30
+ end
31
+
32
+ it "should contain the day" do
33
+ expect(@endpoint).to include(subject.day)
34
+ end
35
+
36
+ it "should contain the name" do
37
+ expect(@endpoint).to include(subject.name)
38
+ end
39
+
40
+ end
41
+
42
+ end
@@ -0,0 +1,36 @@
1
+ shared_examples "a wsdl module with actions" do
2
+
3
+ it "should include wsdl actions" do
4
+ expect(subject.constants).to include(:Actions)
5
+ end
6
+
7
+ describe "the shared Actions of a Wsdl" do
8
+
9
+ before do
10
+ module subject::Actions
11
+ def self.test
12
+ @@test
13
+ end
14
+ def self.test=(val)
15
+ @@test=val
16
+ end
17
+ @@test = nil
18
+ end
19
+ end
20
+
21
+ specify { expect(subject::Actions).to respond_to(:test) }
22
+ specify { expect(subject::Actions).to respond_to(:test=) }
23
+
24
+ it "should modify the value" do
25
+ expect { subject::Actions.test = 1 }.to change { subject::Actions.test }
26
+ end
27
+
28
+ it "should include the action in the endpoint" do
29
+ test_action = "foobar"
30
+ subject::Actions.test = test_action
31
+ expect(subject.endpoint(:test)).to include(test_action)
32
+ end
33
+
34
+ end
35
+
36
+ end
@@ -0,0 +1,53 @@
1
+ shared_examples "a wsdl module" do
2
+
3
+ it { should respond_to(:name) }
4
+ it { should respond_to(:name=) }
5
+ it { should respond_to(:method) }
6
+ it { should respond_to(:method=) }
7
+ it { should respond_to(:endpoint) }
8
+
9
+ it_behaves_like "a configurable class"
10
+
11
+ describe "the return value of #endpoint" do
12
+
13
+ it "should return a fully resolved endpoint name" do
14
+ expect(subject.endpoint).to include(Reuters.wsdl_endpoint)
15
+ end
16
+
17
+ it "should include the correct method" do
18
+ test_method = "foO"
19
+ subject.name = test_method
20
+ expect(subject.endpoint).to include(test_method)
21
+ end
22
+
23
+ it "should include the correct name" do
24
+ test_name = "boooo"
25
+ subject.name = test_name
26
+ expect(subject.endpoint).to include(test_name)
27
+ end
28
+
29
+ end
30
+
31
+ describe "when values are set for the WSDL" do
32
+
33
+ let(:test_name) { "foo" }
34
+ let(:test_method) { "bar" }
35
+
36
+ before do
37
+ subject.configure do |c|
38
+ c.name = test_name
39
+ c.method = test_method
40
+ end
41
+ end
42
+
43
+ it "should set the correct value for the name" do
44
+ expect(subject.name).to eq test_name
45
+ end
46
+
47
+ it "should set the correct value for the method" do
48
+ expect(subject.method).to eq test_method
49
+ end
50
+
51
+ end
52
+
53
+ end
metadata ADDED
@@ -0,0 +1,333 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: reuters
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.1
5
+ platform: ruby
6
+ authors:
7
+ - Stockflare
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: savon
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 2.5.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 2.5.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: yard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: faker
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: redcarpet
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ! '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: cucumber
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: aruba
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ! '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ! '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: factory_girl
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ! '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: codeclimate-test-reporter
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ! '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: coveralls
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ! '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ! '>='
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ! '>='
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ! '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ description: Ruby Gem for interacting with the Thomson Reuters Knowledge Direct API
210
+ email:
211
+ - info@stockflare.com
212
+ executables: []
213
+ extensions: []
214
+ extra_rdoc_files: []
215
+ files:
216
+ - .gitignore
217
+ - .rubocop.enabled.yml
218
+ - .rubocop.yml
219
+ - .ruby-gemset
220
+ - .ruby-version
221
+ - .travis.yml
222
+ - CONTRIBUTING.md
223
+ - Gemfile
224
+ - LICENSE.txt
225
+ - README.md
226
+ - Rakefile
227
+ - lib/reuters.rb
228
+ - lib/reuters/builder.rb
229
+ - lib/reuters/client.rb
230
+ - lib/reuters/client/base.rb
231
+ - lib/reuters/client/fundamentals.rb
232
+ - lib/reuters/client/search.rb
233
+ - lib/reuters/client/search/base.rb
234
+ - lib/reuters/client/search/equity.rb
235
+ - lib/reuters/client/token.rb
236
+ - lib/reuters/credentials.rb
237
+ - lib/reuters/namespaces.rb
238
+ - lib/reuters/namespaces/base.rb
239
+ - lib/reuters/namespaces/common.rb
240
+ - lib/reuters/namespaces/fundamentals.rb
241
+ - lib/reuters/namespaces/search.rb
242
+ - lib/reuters/namespaces/search/equity.rb
243
+ - lib/reuters/namespaces/token.rb
244
+ - lib/reuters/response.rb
245
+ - lib/reuters/version.rb
246
+ - lib/reuters/wsdls.rb
247
+ - lib/reuters/wsdls/base.rb
248
+ - lib/reuters/wsdls/fundamentals.rb
249
+ - lib/reuters/wsdls/search.rb
250
+ - lib/reuters/wsdls/search/equity.rb
251
+ - lib/reuters/wsdls/token.rb
252
+ - reuters.gemspec
253
+ - spec/fixtures/responses/token.xml
254
+ - spec/reuters/builder_spec.rb
255
+ - spec/reuters/client/fundamentals_spec.rb
256
+ - spec/reuters/client/search/equity_spec.rb
257
+ - spec/reuters/client/token_spec.rb
258
+ - spec/reuters/client_spec.rb
259
+ - spec/reuters/credentials_spec.rb
260
+ - spec/reuters/namespaces/common_spec.rb
261
+ - spec/reuters/namespaces/fundamentals_spec.rb
262
+ - spec/reuters/namespaces/search/equity_spec.rb
263
+ - spec/reuters/namespaces/search_spec.rb
264
+ - spec/reuters/namespaces/token_spec.rb
265
+ - spec/reuters/namespaces_spec.rb
266
+ - spec/reuters/response_spec.rb
267
+ - spec/reuters/version_spec.rb
268
+ - spec/reuters/wsdls/fundamentals_spec.rb
269
+ - spec/reuters/wsdls/search/equity_spec.rb
270
+ - spec/reuters/wsdls/token_spec.rb
271
+ - spec/reuters/wsdls_spec.rb
272
+ - spec/reuters_spec.rb
273
+ - spec/spec_helper.rb
274
+ - spec/support/client/search_shared.rb
275
+ - spec/support/client_shared.rb
276
+ - spec/support/configurable_shared.rb
277
+ - spec/support/namespaces_actions_shared.rb
278
+ - spec/support/namespaces_shared.rb
279
+ - spec/support/wsdls_actions_shared.rb
280
+ - spec/support/wsdls_shared.rb
281
+ homepage: https://github.com/stockflare/reuters
282
+ licenses:
283
+ - MIT
284
+ metadata: {}
285
+ post_install_message:
286
+ rdoc_options: []
287
+ require_paths:
288
+ - lib
289
+ required_ruby_version: !ruby/object:Gem::Requirement
290
+ requirements:
291
+ - - ! '>='
292
+ - !ruby/object:Gem::Version
293
+ version: 2.0.0
294
+ required_rubygems_version: !ruby/object:Gem::Requirement
295
+ requirements:
296
+ - - ! '>='
297
+ - !ruby/object:Gem::Version
298
+ version: '0'
299
+ requirements: []
300
+ rubyforge_project:
301
+ rubygems_version: 2.2.2
302
+ signing_key:
303
+ specification_version: 4
304
+ summary: Ruby client for Thomson Reuters Knowledge Direct (TRKD) API
305
+ test_files:
306
+ - spec/fixtures/responses/token.xml
307
+ - spec/reuters/builder_spec.rb
308
+ - spec/reuters/client/fundamentals_spec.rb
309
+ - spec/reuters/client/search/equity_spec.rb
310
+ - spec/reuters/client/token_spec.rb
311
+ - spec/reuters/client_spec.rb
312
+ - spec/reuters/credentials_spec.rb
313
+ - spec/reuters/namespaces/common_spec.rb
314
+ - spec/reuters/namespaces/fundamentals_spec.rb
315
+ - spec/reuters/namespaces/search/equity_spec.rb
316
+ - spec/reuters/namespaces/search_spec.rb
317
+ - spec/reuters/namespaces/token_spec.rb
318
+ - spec/reuters/namespaces_spec.rb
319
+ - spec/reuters/response_spec.rb
320
+ - spec/reuters/version_spec.rb
321
+ - spec/reuters/wsdls/fundamentals_spec.rb
322
+ - spec/reuters/wsdls/search/equity_spec.rb
323
+ - spec/reuters/wsdls/token_spec.rb
324
+ - spec/reuters/wsdls_spec.rb
325
+ - spec/reuters_spec.rb
326
+ - spec/spec_helper.rb
327
+ - spec/support/client/search_shared.rb
328
+ - spec/support/client_shared.rb
329
+ - spec/support/configurable_shared.rb
330
+ - spec/support/namespaces_actions_shared.rb
331
+ - spec/support/namespaces_shared.rb
332
+ - spec/support/wsdls_actions_shared.rb
333
+ - spec/support/wsdls_shared.rb