iex-ruby-client 1.6.0 → 2.1.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.
- checksums.yaml +4 -4
- data/.github/workflows/danger.yml +20 -0
- data/.github/workflows/rubocop.yml +14 -0
- data/.github/workflows/test.yml +25 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +8 -1
- data/CHANGELOG.md +9 -0
- data/CONTRIBUTING.md +1 -1
- data/Gemfile.danger +6 -0
- data/README.md +19 -4
- data/RELEASING.md +1 -1
- data/UPGRADING.md +15 -0
- data/iex-ruby-client.gemspec +3 -3
- data/lib/iex/api/config/client.rb +2 -2
- data/lib/iex/cloud/connection.rb +9 -7
- data/lib/iex/endpoints/ref_data.rb +5 -0
- data/lib/iex/resources/symbols.rb +5 -0
- data/lib/iex/version.rb +1 -1
- data/lib/iex-ruby-client.rb +1 -2
- data/spec/fixtures/iex/ref-data/exchange_symbols.yml +1 -1869
- data/spec/fixtures/iex/ref-data/region_symbols.yml +58 -0
- data/spec/iex/config/client_spec.rb +9 -3
- data/spec/iex/endpoints/ref_data_spec.rb +38 -8
- data/spec/support/client.rb +2 -0
- metadata +13 -8
- data/.travis.yml +0 -9
@@ -1,20 +1,26 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe IEX::Api::Config::Client do
|
4
|
-
before
|
5
|
-
|
6
|
-
end
|
4
|
+
before { IEX::Api.config.reset! }
|
5
|
+
|
7
6
|
describe '#defaults' do
|
8
7
|
it 'sets endpoint' do
|
9
8
|
expect(IEX::Api.config.endpoint).to eq 'https://cloud.iexapis.com/v1'
|
10
9
|
end
|
10
|
+
|
11
|
+
it 'does not set SSL options by default' do
|
12
|
+
expect(IEX::Api.config.ca_file).to be_nil
|
13
|
+
expect(IEX::Api.config.ca_path).to be_nil
|
14
|
+
end
|
11
15
|
end
|
16
|
+
|
12
17
|
describe '#configure' do
|
13
18
|
before do
|
14
19
|
IEX::Api.configure do |config|
|
15
20
|
config.endpoint = 'updated'
|
16
21
|
end
|
17
22
|
end
|
23
|
+
|
18
24
|
it 'sets endpoint' do
|
19
25
|
expect(IEX::Api.config.endpoint).to eq 'updated'
|
20
26
|
end
|
@@ -87,24 +87,54 @@ describe IEX::Api::Client do
|
|
87
87
|
subject { client.ref_data_symbols_for_exchange('TSX') }
|
88
88
|
|
89
89
|
it 'retrieves all symbols' do
|
90
|
-
expect(subject.count).to eq
|
90
|
+
expect(subject.count).to eq 2351
|
91
91
|
end
|
92
92
|
|
93
93
|
context 'first symbol' do
|
94
94
|
subject { client.ref_data_symbols_for_exchange('TSX').first }
|
95
95
|
it 'retrieves a symbol data' do
|
96
|
-
expect(subject.symbol).to eq 'A-
|
97
|
-
expect(subject.exchange).to eq '
|
98
|
-
expect(subject.name).to eq '
|
99
|
-
expect(subject.date).to eq Date.parse('2021-
|
96
|
+
expect(subject.symbol).to eq 'A-CT'
|
97
|
+
expect(subject.exchange).to eq 'XTSE'
|
98
|
+
expect(subject.name).to eq 'Aurigen Capital Limited'
|
99
|
+
expect(subject.date).to eq Date.parse('2021-12-20')
|
100
100
|
expect(subject.enabled).to eq true
|
101
101
|
expect(subject.enabled?).to eq true
|
102
102
|
expect(subject.type).to eq 'cs'
|
103
103
|
expect(subject.region).to eq 'CA'
|
104
104
|
expect(subject.currency).to eq 'CAD'
|
105
|
-
expect(subject.iex_id).to eq
|
106
|
-
expect(subject.figi).to eq
|
107
|
-
expect(subject.cik).to eq
|
105
|
+
expect(subject.iex_id).to eq nil
|
106
|
+
expect(subject.figi).to eq nil
|
107
|
+
expect(subject.cik).to eq nil
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
describe '#ref_data_symbols_for_region', vcr: { cassette_name: 'ref-data/region_symbols' } do
|
113
|
+
subject { client.ref_data_symbols_for_region('ca') }
|
114
|
+
|
115
|
+
it 'retrieves all symbols' do
|
116
|
+
expect(subject.count).to eq 4977
|
117
|
+
end
|
118
|
+
|
119
|
+
context 'first symbol' do
|
120
|
+
subject { client.ref_data_symbols_for_region('ca').first }
|
121
|
+
it 'retrieves symbol data' do
|
122
|
+
expect(subject.symbol).to eq 'A-CT'
|
123
|
+
expect(subject.exchange).to eq 'XTSE'
|
124
|
+
expect(subject.exchange_suffix).to eq 'CT'
|
125
|
+
expect(subject.exchange_name).to eq 'Toronto Stock Exchange'
|
126
|
+
expect(subject.exchange_segment).to eq 'XTSE'
|
127
|
+
expect(subject.name).to eq 'Aurigen Capital Limited'
|
128
|
+
expect(subject.date).to eq Date.parse('2021-12-20')
|
129
|
+
expect(subject.enabled).to eq true
|
130
|
+
expect(subject.enabled?).to eq true
|
131
|
+
expect(subject.type).to eq 'cs'
|
132
|
+
expect(subject.region).to eq 'CA'
|
133
|
+
expect(subject.currency).to eq 'CAD'
|
134
|
+
expect(subject.iex_id).to eq nil
|
135
|
+
expect(subject.figi).to eq nil
|
136
|
+
expect(subject.cik).to eq nil
|
137
|
+
expect(subject.lei).to eq nil
|
108
138
|
end
|
109
139
|
end
|
110
140
|
end
|
data/spec/support/client.rb
CHANGED
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.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Doubrovkine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.17'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: faraday-multipart
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: 0.75.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
110
|
+
version: 0.75.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: vcr
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,15 +144,18 @@ extra_rdoc_files: []
|
|
144
144
|
files:
|
145
145
|
- ".env.sample"
|
146
146
|
- ".github/FUNDING.yml"
|
147
|
+
- ".github/workflows/danger.yml"
|
148
|
+
- ".github/workflows/rubocop.yml"
|
149
|
+
- ".github/workflows/test.yml"
|
147
150
|
- ".gitignore"
|
148
151
|
- ".rspec"
|
149
152
|
- ".rubocop.yml"
|
150
153
|
- ".rubocop_todo.yml"
|
151
|
-
- ".travis.yml"
|
152
154
|
- CHANGELOG.md
|
153
155
|
- CONTRIBUTING.md
|
154
156
|
- Dangerfile
|
155
157
|
- Gemfile
|
158
|
+
- Gemfile.danger
|
156
159
|
- LICENSE.md
|
157
160
|
- README.md
|
158
161
|
- RELEASING.md
|
@@ -279,6 +282,7 @@ files:
|
|
279
282
|
- spec/fixtures/iex/ref-data/exchange_symbols.yml
|
280
283
|
- spec/fixtures/iex/ref-data/isin.yml
|
281
284
|
- spec/fixtures/iex/ref-data/isin_mapped.yml
|
285
|
+
- spec/fixtures/iex/ref-data/region_symbols.yml
|
282
286
|
- spec/fixtures/iex/ref-data/symbols.yml
|
283
287
|
- spec/fixtures/iex/ref-data/wrong_isin_mapped.yml
|
284
288
|
- spec/fixtures/iex/sectors/invalid.yml
|
@@ -326,14 +330,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
326
330
|
requirements:
|
327
331
|
- - ">="
|
328
332
|
- !ruby/object:Gem::Version
|
329
|
-
version: 2.
|
333
|
+
version: 2.4.0
|
330
334
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
331
335
|
requirements:
|
332
336
|
- - ">="
|
333
337
|
- !ruby/object:Gem::Version
|
334
338
|
version: 1.3.6
|
335
339
|
requirements: []
|
336
|
-
rubygems_version: 3.
|
340
|
+
rubygems_version: 3.3.7
|
337
341
|
signing_key:
|
338
342
|
specification_version: 4
|
339
343
|
summary: IEX Finance API Ruby client with support for retrieving stock quotes.
|
@@ -396,6 +400,7 @@ test_files:
|
|
396
400
|
- spec/fixtures/iex/ref-data/exchange_symbols.yml
|
397
401
|
- spec/fixtures/iex/ref-data/isin.yml
|
398
402
|
- spec/fixtures/iex/ref-data/isin_mapped.yml
|
403
|
+
- spec/fixtures/iex/ref-data/region_symbols.yml
|
399
404
|
- spec/fixtures/iex/ref-data/symbols.yml
|
400
405
|
- spec/fixtures/iex/ref-data/wrong_isin_mapped.yml
|
401
406
|
- spec/fixtures/iex/sectors/invalid.yml
|