iex-ruby-client 1.1.2 → 1.2.0

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.
@@ -1,18 +1,18 @@
1
1
  ---
2
2
  http_interactions:
3
3
  - request:
4
- method: post
5
- uri: https://cloud.iexapis.com/v1/ref-data/isin
4
+ method: get
5
+ uri: https://cloud.iexapis.com/v1/ref-data/isin?isin=WRONG12345&mapped=true&token=test-iex-api-publishable-token
6
6
  body:
7
- encoding: UTF-8
8
- string: '{"token":"test-iex-api-publishable-token","isin":["WRONG12345"],"mapped":true}'
7
+ encoding: US-ASCII
8
+ string: ''
9
9
  headers:
10
10
  Accept:
11
11
  - application/json; charset=utf-8
12
12
  Content-Type:
13
13
  - application/json; charset=utf-8
14
14
  User-Agent:
15
- - IEX Ruby Client/1.1.2
15
+ - IEX Ruby Client/1.1.3
16
16
  Accept-Encoding:
17
17
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
18
  response:
@@ -23,7 +23,7 @@ http_interactions:
23
23
  Server:
24
24
  - nginx
25
25
  Date:
26
- - Wed, 25 Mar 2020 10:15:28 GMT
26
+ - Fri, 10 Apr 2020 15:17:34 GMT
27
27
  Content-Type:
28
28
  - application/json; charset=utf-8
29
29
  Content-Length:
@@ -31,8 +31,8 @@ http_interactions:
31
31
  Connection:
32
32
  - keep-alive
33
33
  Set-Cookie:
34
- - ctoken=9ddb19d57dea471f9855bacdb85a96a5; Max-Age=43200; Path=/; Expires=Wed,
35
- 25 Mar 2020 22:15:28 GMT
34
+ - ctoken=84910330e5ea4058969d0af364c32947; Max-Age=43200; Path=/; Expires=Sat,
35
+ 11 Apr 2020 03:17:34 GMT
36
36
  Iexcloud-Messages-Used:
37
37
  - '100'
38
38
  Iexcloud-Premium-Messages-Used:
@@ -53,5 +53,5 @@ http_interactions:
53
53
  encoding: UTF-8
54
54
  string: '{"WRONG12345":null}'
55
55
  http_version: null
56
- recorded_at: Wed, 25 Mar 2020 10:15:28 GMT
56
+ recorded_at: Fri, 10 Apr 2020 15:17:34 GMT
57
57
  recorded_with: VCR 5.1.0
@@ -17,6 +17,11 @@ describe IEX::Api::Client do
17
17
  expect(client.user_agent).to eq IEX::Api::Config.user_agent
18
18
  expect(client.user_agent).to include IEX::VERSION
19
19
  end
20
+ it 'caches the Faraday connection to allow persistent adapters' do
21
+ first = client.send(:connection)
22
+ second = client.send(:connection)
23
+ expect(first).to equal second
24
+ end
20
25
  (IEX::Api::Config::ATTRIBUTES - [:logger]).each do |key|
21
26
  it "sets #{key}" do
22
27
  expect(client.send(key)).to eq IEX::Api::Config.send(key)
@@ -18,6 +18,8 @@ describe IEX::Resources::Quote do
18
18
  expect(subject.week_52_low).to eq 87.73
19
19
  expect(subject.change_percent).to eq(-0.00508)
20
20
  expect(subject.change_percent_s).to eq '-0.51%'
21
+ expect(subject.extended_change_percent).to eq(-0.00008)
22
+ expect(subject.extended_change_percent_s).to eq '-0.01%'
21
23
  end
22
24
  it 'coerces times' do
23
25
  expect(subject.latest_update).to eq 1_554_408_000_193
@@ -37,4 +37,30 @@ describe IEX::Api::Client do
37
37
  end
38
38
  end
39
39
  end
40
+
41
+ describe '#ref_data_symbols', vcr: { cassette_name: 'ref-data/symbols' } do
42
+ subject { client.ref_data_symbols }
43
+
44
+ it 'retrieves all symbols' do
45
+ expect(subject.count).to eq 8808
46
+ end
47
+
48
+ context 'first symbol' do
49
+ subject { client.ref_data_symbols.first }
50
+ it 'retrieves a symbol data' do
51
+ expect(subject.symbol).to eq 'A'
52
+ expect(subject.exchange).to eq 'NYS'
53
+ expect(subject.name).to eq 'Agilent Technologies Inc.'
54
+ expect(subject.date).to eq Date.parse('2020-04-30')
55
+ expect(subject.enabled).to eq true
56
+ expect(subject.enabled?).to eq true
57
+ expect(subject.type).to eq 'cs'
58
+ expect(subject.region).to eq 'US'
59
+ expect(subject.currency).to eq 'USD'
60
+ expect(subject.iex_id).to eq 'IEX_46574843354B2D52'
61
+ expect(subject.figi).to eq 'BBG000C2V3D6'
62
+ expect(subject.cik).to eq '1090872'
63
+ end
64
+ end
65
+ end
40
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iex-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-25 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.9'
19
+ version: '0.17'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0.9'
26
+ version: '0.17'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday_middleware
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -136,12 +136,13 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- description:
139
+ description:
140
140
  email: dblock@dblock.org
141
141
  executables: []
142
142
  extensions: []
143
143
  extra_rdoc_files: []
144
144
  files:
145
+ - ".github/FUNDING.yml"
145
146
  - ".gitignore"
146
147
  - ".rspec"
147
148
  - ".rubocop.yml"
@@ -202,6 +203,7 @@ files:
202
203
  - lib/iex/resources/resource.rb
203
204
  - lib/iex/resources/sectors.rb
204
205
  - lib/iex/resources/symbol.rb
206
+ - lib/iex/resources/symbols.rb
205
207
  - lib/iex/version.rb
206
208
  - spec/fixtures/iex/chart/1d.yml
207
209
  - spec/fixtures/iex/chart/20190306.yml
@@ -240,6 +242,7 @@ files:
240
242
  - spec/fixtures/iex/quote/msft.yml
241
243
  - spec/fixtures/iex/ref-data/isin.yml
242
244
  - spec/fixtures/iex/ref-data/isin_mapped.yml
245
+ - spec/fixtures/iex/ref-data/symbols.yml
243
246
  - spec/fixtures/iex/ref-data/wrong_isin_mapped.yml
244
247
  - spec/fixtures/iex/sectors/invalid.yml
245
248
  - spec/fixtures/iex/sectors/sectors-performance.yml
@@ -271,7 +274,7 @@ homepage: http://github.com/dblock/iex-ruby-client
271
274
  licenses:
272
275
  - MIT
273
276
  metadata: {}
274
- post_install_message:
277
+ post_install_message:
275
278
  rdoc_options: []
276
279
  require_paths:
277
280
  - lib
@@ -286,8 +289,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
286
289
  - !ruby/object:Gem::Version
287
290
  version: 1.3.6
288
291
  requirements: []
289
- rubygems_version: 3.0.6
290
- signing_key:
292
+ rubygems_version: 3.1.3
293
+ signing_key:
291
294
  specification_version: 4
292
295
  summary: IEX Finance API Ruby client with support for retrieving stock quotes.
293
296
  test_files:
@@ -328,6 +331,7 @@ test_files:
328
331
  - spec/fixtures/iex/quote/msft.yml
329
332
  - spec/fixtures/iex/ref-data/isin.yml
330
333
  - spec/fixtures/iex/ref-data/isin_mapped.yml
334
+ - spec/fixtures/iex/ref-data/symbols.yml
331
335
  - spec/fixtures/iex/ref-data/wrong_isin_mapped.yml
332
336
  - spec/fixtures/iex/sectors/invalid.yml
333
337
  - spec/fixtures/iex/sectors/sectors-performance.yml