iex-ruby-client 1.1.0 → 1.4.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.
Files changed (98) hide show
  1. checksums.yaml +5 -5
  2. data/.env.sample +2 -0
  3. data/.github/FUNDING.yml +1 -0
  4. data/.rubocop_todo.yml +0 -8
  5. data/CHANGELOG.md +48 -10
  6. data/Dangerfile +2 -2
  7. data/Gemfile +3 -2
  8. data/README.md +260 -11
  9. data/RELEASING.md +2 -2
  10. data/iex-ruby-client.gemspec +2 -1
  11. data/lib/iex/api.rb +8 -1
  12. data/lib/iex/api/client.rb +15 -2
  13. data/lib/iex/api/config/client.rb +52 -0
  14. data/lib/iex/api/config/logger.rb +35 -0
  15. data/lib/iex/cloud/connection.rb +22 -19
  16. data/lib/iex/cloud/request.rb +1 -1
  17. data/lib/iex/cloud/response.rb +1 -1
  18. data/lib/iex/endpoints/advanced_stats.rb +11 -0
  19. data/lib/iex/endpoints/balance_sheet.rb +13 -0
  20. data/lib/iex/endpoints/cash_flow.rb +13 -0
  21. data/lib/iex/endpoints/chart.rb +1 -1
  22. data/lib/iex/endpoints/company.rb +1 -1
  23. data/lib/iex/endpoints/crypto.rb +1 -1
  24. data/lib/iex/endpoints/dividends.rb +1 -1
  25. data/lib/iex/endpoints/earnings.rb +1 -1
  26. data/lib/iex/endpoints/historial_prices.rb +30 -0
  27. data/lib/iex/endpoints/income.rb +1 -1
  28. data/lib/iex/endpoints/key_stats.rb +1 -1
  29. data/lib/iex/endpoints/largest_trades.rb +1 -1
  30. data/lib/iex/endpoints/logo.rb +1 -1
  31. data/lib/iex/endpoints/news.rb +1 -1
  32. data/lib/iex/endpoints/ohlc.rb +2 -2
  33. data/lib/iex/endpoints/price.rb +1 -1
  34. data/lib/iex/endpoints/quote.rb +1 -1
  35. data/lib/iex/endpoints/ref_data.rb +22 -0
  36. data/lib/iex/endpoints/sectors.rb +1 -1
  37. data/lib/iex/endpoints/stock_market.rb +11 -0
  38. data/lib/iex/resources.rb +6 -0
  39. data/lib/iex/resources/advanced_stats.rb +84 -0
  40. data/lib/iex/resources/balance_sheet.rb +60 -0
  41. data/lib/iex/resources/cash_flow.rb +43 -0
  42. data/lib/iex/resources/chart.rb +8 -13
  43. data/lib/iex/resources/historical_prices.rb +31 -0
  44. data/lib/iex/resources/income.rb +2 -0
  45. data/lib/iex/resources/key_stats.rb +1 -1
  46. data/lib/iex/resources/quote.rb +12 -2
  47. data/lib/iex/resources/resource.rb +12 -0
  48. data/lib/iex/resources/symbol.rb +10 -0
  49. data/lib/iex/resources/symbols.rb +19 -0
  50. data/lib/iex/version.rb +1 -1
  51. data/spec/fixtures/iex/advanced_stats/invalid.yml +50 -0
  52. data/spec/fixtures/iex/advanced_stats/msft.yml +57 -0
  53. data/spec/fixtures/iex/balance_sheet/invalid.yml +50 -0
  54. data/spec/fixtures/iex/balance_sheet/msft.yml +56 -0
  55. data/spec/fixtures/iex/cash_flow/invalid.yml +50 -0
  56. data/spec/fixtures/iex/cash_flow/msft.yml +56 -0
  57. data/spec/fixtures/iex/chart/1d.yml +440 -473
  58. data/spec/fixtures/iex/chart/20190306.yml +440 -473
  59. data/spec/fixtures/iex/chart/bad_option.yml +47 -81
  60. data/spec/fixtures/iex/chart/chartInterval.yml +89 -122
  61. data/spec/fixtures/iex/chart/dynamic/1m.yml +73 -107
  62. data/spec/fixtures/iex/chart/invalid.yml +47 -81
  63. data/spec/fixtures/iex/chart/msft.yml +74 -107
  64. data/spec/fixtures/iex/historical_prices/abcd.yml +56 -0
  65. data/spec/fixtures/iex/historical_prices/invalid.yml +50 -0
  66. data/spec/fixtures/iex/historical_prices/invalid_date.yml +50 -0
  67. data/spec/fixtures/iex/historical_prices/invalid_range.yml +47 -0
  68. data/spec/fixtures/iex/historical_prices/msft.yml +79 -0
  69. data/spec/fixtures/iex/historical_prices/msft_5d.yml +61 -0
  70. data/spec/fixtures/iex/historical_prices/msft_date_and_chart_by_day.yml +57 -0
  71. data/spec/fixtures/iex/historical_prices/msft_specific_date_trimmed.yml +445 -0
  72. data/spec/fixtures/iex/income/invalid.yml +47 -47
  73. data/spec/fixtures/iex/income/msft.yml +54 -51
  74. data/spec/fixtures/iex/income/nsrgy.yml +55 -0
  75. data/spec/fixtures/iex/ref-data/isin.yml +57 -0
  76. data/spec/fixtures/iex/ref-data/isin_mapped.yml +57 -0
  77. data/spec/fixtures/iex/ref-data/symbols.yml +9002 -0
  78. data/spec/fixtures/iex/ref-data/wrong_isin_mapped.yml +57 -0
  79. data/spec/fixtures/iex/stock_market/list_mostactive.yml +76 -0
  80. data/spec/iex/client_spec.rb +97 -14
  81. data/spec/iex/config/client_spec.rb +49 -0
  82. data/spec/iex/config/logger_spec.rb +46 -0
  83. data/spec/iex/endpoints/advanced_stats_spec.rb +110 -0
  84. data/spec/iex/endpoints/balance_sheet_spec.rb +80 -0
  85. data/spec/iex/endpoints/cash_flow_spec.rb +59 -0
  86. data/spec/iex/endpoints/chart_spec.rb +7 -7
  87. data/spec/iex/endpoints/historical_prices_spec.rb +206 -0
  88. data/spec/iex/endpoints/income_spec.rb +41 -30
  89. data/spec/iex/endpoints/key_stats_spec.rb +1 -0
  90. data/spec/iex/endpoints/quote_spec.rb +2 -0
  91. data/spec/iex/endpoints/ref_data_spec.rb +76 -0
  92. data/spec/iex/endpoints/stock_market_spec.rb +14 -0
  93. data/spec/iex/resources/resource_spec.rb +36 -0
  94. data/spec/spec_helper.rb +3 -2
  95. data/spec/support/vcr.rb +3 -0
  96. metadata +82 -14
  97. data/lib/iex/api/config.rb +0 -45
  98. data/spec/iex/config_spec.rb +0 -22
@@ -19,6 +19,7 @@ describe IEX::Resources::KeyStats do
19
19
  expect(subject.week_52_high_dollar).to eq '$136.04'
20
20
  expect(subject.week_52_low).to eq 95.92
21
21
  expect(subject.week_52_low_dollar).to eq '$95.92'
22
+ expect(subject.week_52_change).to eq 0.371641
22
23
  expect(subject.week_52_change_dollar).to eq '$0.37'
23
24
  end
24
25
 
@@ -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
@@ -0,0 +1,76 @@
1
+ require 'spec_helper'
2
+
3
+ describe IEX::Api::Client do
4
+ include_context 'client'
5
+
6
+ describe '#ref_data_isin', vcr: { cassette_name: 'ref-data/isin' } do
7
+ context 'without options' do
8
+ subject { client.ref_data_isin(['US0378331005']) }
9
+
10
+ it 'converts ISIN to IEX Cloud symbols' do
11
+ expect(subject.count).to eq(2)
12
+ expect(subject.first).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_4D48333344362D52', 'region' => 'US', 'symbol' => 'AAPL')
13
+ expect(subject.last).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_464D46474C312D52', 'region' => 'DE', 'symbol' => 'APC-GY')
14
+ end
15
+ end
16
+
17
+ context 'graciously handle parameter as string', vcr: { cassette_name: 'ref-data/isin' } do
18
+ subject { client.ref_data_isin('US0378331005') }
19
+
20
+ it 'converts ISIN to IEX Cloud symbols' do
21
+ expect(subject.count).to eq(2)
22
+ expect(subject.first).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_4D48333344362D52', 'region' => 'US', 'symbol' => 'AAPL')
23
+ expect(subject.last).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_464D46474C312D52', 'region' => 'DE', 'symbol' => 'APC-GY')
24
+ end
25
+ end
26
+
27
+ context 'with mapped option', vcr: { cassette_name: 'ref-data/isin_mapped' } do
28
+ subject { client.ref_data_isin(%w[US0378331005 US5949181045], mapped: true) }
29
+
30
+ it 'converts ISINs to IEX Cloud symbols mapped by ISIN' do
31
+ expect(subject.keys).to contain_exactly('US0378331005', 'US5949181045')
32
+
33
+ expect(subject['US0378331005'].first).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_4D48333344362D52', 'region' => 'US', 'symbol' => 'AAPL')
34
+ expect(subject['US0378331005'].last).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_464D46474C312D52', 'region' => 'DE', 'symbol' => 'APC-GY')
35
+
36
+ expect(subject['US5949181045'][0]).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_5038523343322D52', 'region' => 'US', 'symbol' => 'MSFT')
37
+ expect(subject['US5949181045'][1]).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_4C42583859482D52', 'region' => 'DE', 'symbol' => 'MSF-GY')
38
+ expect(subject['US5949181045'][2]).to eq('exchange' => 'BRU', 'iex_id' => 'IEX_5833345950432D52', 'region' => 'BE', 'symbol' => 'MSF-BB')
39
+ end
40
+ end
41
+
42
+ context 'with wrong ISIN', vcr: { cassette_name: 'ref-data/wrong_isin_mapped' } do
43
+ subject { client.ref_data_isin(%w[WRONG12345], mapped: true) }
44
+
45
+ it 'returns nil value for given ISIN' do
46
+ expect(subject).to eq('WRONG12345' => nil)
47
+ end
48
+ end
49
+ end
50
+
51
+ describe '#ref_data_symbols', vcr: { cassette_name: 'ref-data/symbols' } do
52
+ subject { client.ref_data_symbols }
53
+
54
+ it 'retrieves all symbols' do
55
+ expect(subject.count).to eq 8808
56
+ end
57
+
58
+ context 'first symbol' do
59
+ subject { client.ref_data_symbols.first }
60
+ it 'retrieves a symbol data' do
61
+ expect(subject.symbol).to eq 'A'
62
+ expect(subject.exchange).to eq 'NYS'
63
+ expect(subject.name).to eq 'Agilent Technologies Inc.'
64
+ expect(subject.date).to eq Date.parse('2020-04-30')
65
+ expect(subject.enabled).to eq true
66
+ expect(subject.enabled?).to eq true
67
+ expect(subject.type).to eq 'cs'
68
+ expect(subject.region).to eq 'US'
69
+ expect(subject.currency).to eq 'USD'
70
+ expect(subject.iex_id).to eq 'IEX_46574843354B2D52'
71
+ expect(subject.figi).to eq 'BBG000C2V3D6'
72
+ expect(subject.cik).to eq '1090872'
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe IEX::Endpoints::StockMarket do
4
+ include_context 'client'
5
+
6
+ describe '#stock_market_list', vcr: { cassette_name: 'stock_market/list_mostactive' } do
7
+ subject { client.stock_market_list(:mostactive) }
8
+
9
+ it 'retrieves a list of quotes' do
10
+ expect(subject).to all(be_a(IEX::Resources::Quote))
11
+ expect(subject.map(&:symbol)).to match_array(%w[AAPL AMD BAC F GE INO INTC MSFT T XOM])
12
+ end
13
+ end
14
+ end
@@ -37,6 +37,42 @@ describe IEX::Resources::Resource do
37
37
  end
38
38
  end
39
39
 
40
+ context 'percent to string (Positive)' do
41
+ subject do
42
+ IEX::Resources::Resource.percentage_to_string(3.3793)
43
+ end
44
+ it 'converts to percentage' do
45
+ expect(subject).to eq '+3.38%'
46
+ end
47
+ end
48
+
49
+ context 'percent to string (Negative)' do
50
+ subject do
51
+ IEX::Resources::Resource.percentage_to_string(-3.3793)
52
+ end
53
+ it 'converts to percentage' do
54
+ expect(subject).to eq '-3.38%'
55
+ end
56
+ end
57
+
58
+ context 'percent to string (nil)' do
59
+ subject do
60
+ IEX::Resources::Resource.percentage_to_string(nil)
61
+ end
62
+ it 'nil argument does not convert' do
63
+ expect(subject).to eq nil
64
+ end
65
+ end
66
+
67
+ context 'float number to percent (0)' do
68
+ subject do
69
+ IEX::Resources::Resource.percentage_to_string(0)
70
+ end
71
+ it 'Zero converts to +0.00%' do
72
+ expect(subject).to eq '+0.00%'
73
+ end
74
+ end
75
+
40
76
  context 'Unformatted money amount to dollar' do
41
77
  subject do
42
78
  IEX::Resources::Resource.to_dollar(amount: 123_391)
@@ -2,11 +2,12 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..'))
2
2
 
3
3
  require 'rubygems'
4
4
  require 'rspec'
5
+ require 'dotenv'
5
6
 
6
7
  require 'iex-ruby-client'
7
8
 
8
- Dir[File.join(File.dirname(__FILE__), 'support', '**/*.rb')].each do |file|
9
+ Dir[File.join(File.dirname(__FILE__), 'support', '**/*.rb')].sort.each do |file|
9
10
  require file
10
11
  end
11
12
 
12
- ENV['IEX_API_PUBLISHABLE_TOKEN'] ||= 'test-iex-api-publishable-token'
13
+ Dotenv.load('.env', '.env.sample')
@@ -6,4 +6,7 @@ VCR.configure do |config|
6
6
  config.hook_into :webmock
7
7
  # config.default_cassette_options = { record: :new_episodes }
8
8
  config.configure_rspec_metadata!
9
+
10
+ config.filter_sensitive_data('test-iex-api-publishable-token') { ENV['IEX_API_PUBLISHABLE_TOKEN'] }
11
+ config.filter_sensitive_data('test-iex-api-secret-token') { ENV['IEX_API_SECRET_TOKEN'] }
9
12
  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.0
4
+ version: 1.4.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: 2019-07-08 00:00:00.000000000 Z
11
+ date: 2020-11-19 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,14 @@ 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
+ - ".env.sample"
146
+ - ".github/FUNDING.yml"
145
147
  - ".gitignore"
146
148
  - ".rspec"
147
149
  - ".rubocop.yml"
@@ -160,16 +162,21 @@ files:
160
162
  - lib/iex-ruby-client.rb
161
163
  - lib/iex/api.rb
162
164
  - lib/iex/api/client.rb
163
- - lib/iex/api/config.rb
165
+ - lib/iex/api/config/client.rb
166
+ - lib/iex/api/config/logger.rb
164
167
  - lib/iex/cloud.rb
165
168
  - lib/iex/cloud/connection.rb
166
169
  - lib/iex/cloud/request.rb
167
170
  - lib/iex/cloud/response.rb
171
+ - lib/iex/endpoints/advanced_stats.rb
172
+ - lib/iex/endpoints/balance_sheet.rb
173
+ - lib/iex/endpoints/cash_flow.rb
168
174
  - lib/iex/endpoints/chart.rb
169
175
  - lib/iex/endpoints/company.rb
170
176
  - lib/iex/endpoints/crypto.rb
171
177
  - lib/iex/endpoints/dividends.rb
172
178
  - lib/iex/endpoints/earnings.rb
179
+ - lib/iex/endpoints/historial_prices.rb
173
180
  - lib/iex/endpoints/income.rb
174
181
  - lib/iex/endpoints/key_stats.rb
175
182
  - lib/iex/endpoints/largest_trades.rb
@@ -178,18 +185,24 @@ files:
178
185
  - lib/iex/endpoints/ohlc.rb
179
186
  - lib/iex/endpoints/price.rb
180
187
  - lib/iex/endpoints/quote.rb
188
+ - lib/iex/endpoints/ref_data.rb
181
189
  - lib/iex/endpoints/sectors.rb
190
+ - lib/iex/endpoints/stock_market.rb
182
191
  - lib/iex/errors.rb
183
192
  - lib/iex/errors/client_error.rb
184
193
  - lib/iex/errors/permission_denied_error.rb
185
194
  - lib/iex/errors/symbol_not_found_error.rb
186
195
  - lib/iex/logger.rb
187
196
  - lib/iex/resources.rb
197
+ - lib/iex/resources/advanced_stats.rb
198
+ - lib/iex/resources/balance_sheet.rb
199
+ - lib/iex/resources/cash_flow.rb
188
200
  - lib/iex/resources/chart.rb
189
201
  - lib/iex/resources/company.rb
190
202
  - lib/iex/resources/crypto.rb
191
203
  - lib/iex/resources/dividends.rb
192
204
  - lib/iex/resources/earnings.rb
205
+ - lib/iex/resources/historical_prices.rb
193
206
  - lib/iex/resources/income.rb
194
207
  - lib/iex/resources/key_stats.rb
195
208
  - lib/iex/resources/largest_trades.rb
@@ -199,7 +212,15 @@ files:
199
212
  - lib/iex/resources/quote.rb
200
213
  - lib/iex/resources/resource.rb
201
214
  - lib/iex/resources/sectors.rb
215
+ - lib/iex/resources/symbol.rb
216
+ - lib/iex/resources/symbols.rb
202
217
  - lib/iex/version.rb
218
+ - spec/fixtures/iex/advanced_stats/invalid.yml
219
+ - spec/fixtures/iex/advanced_stats/msft.yml
220
+ - spec/fixtures/iex/balance_sheet/invalid.yml
221
+ - spec/fixtures/iex/balance_sheet/msft.yml
222
+ - spec/fixtures/iex/cash_flow/invalid.yml
223
+ - spec/fixtures/iex/cash_flow/msft.yml
203
224
  - spec/fixtures/iex/chart/1d.yml
204
225
  - spec/fixtures/iex/chart/20190306.yml
205
226
  - spec/fixtures/iex/chart/bad_option.yml
@@ -218,8 +239,17 @@ files:
218
239
  - spec/fixtures/iex/dividends/msft_invalid_range.yml
219
240
  - spec/fixtures/iex/earnings/invalid.yml
220
241
  - spec/fixtures/iex/earnings/msft.yml
242
+ - spec/fixtures/iex/historical_prices/abcd.yml
243
+ - spec/fixtures/iex/historical_prices/invalid.yml
244
+ - spec/fixtures/iex/historical_prices/invalid_date.yml
245
+ - spec/fixtures/iex/historical_prices/invalid_range.yml
246
+ - spec/fixtures/iex/historical_prices/msft.yml
247
+ - spec/fixtures/iex/historical_prices/msft_5d.yml
248
+ - spec/fixtures/iex/historical_prices/msft_date_and_chart_by_day.yml
249
+ - spec/fixtures/iex/historical_prices/msft_specific_date_trimmed.yml
221
250
  - spec/fixtures/iex/income/invalid.yml
222
251
  - spec/fixtures/iex/income/msft.yml
252
+ - spec/fixtures/iex/income/nsrgy.yml
223
253
  - spec/fixtures/iex/key_stats/invalid.yml
224
254
  - spec/fixtures/iex/key_stats/msft.yml
225
255
  - spec/fixtures/iex/largest-trades/aapl.yml
@@ -234,15 +264,25 @@ files:
234
264
  - spec/fixtures/iex/price/msft.yml
235
265
  - spec/fixtures/iex/quote/invalid.yml
236
266
  - spec/fixtures/iex/quote/msft.yml
267
+ - spec/fixtures/iex/ref-data/isin.yml
268
+ - spec/fixtures/iex/ref-data/isin_mapped.yml
269
+ - spec/fixtures/iex/ref-data/symbols.yml
270
+ - spec/fixtures/iex/ref-data/wrong_isin_mapped.yml
237
271
  - spec/fixtures/iex/sectors/invalid.yml
238
272
  - spec/fixtures/iex/sectors/sectors-performance.yml
273
+ - spec/fixtures/iex/stock_market/list_mostactive.yml
239
274
  - spec/iex/client_spec.rb
240
- - spec/iex/config_spec.rb
275
+ - spec/iex/config/client_spec.rb
276
+ - spec/iex/config/logger_spec.rb
277
+ - spec/iex/endpoints/advanced_stats_spec.rb
278
+ - spec/iex/endpoints/balance_sheet_spec.rb
279
+ - spec/iex/endpoints/cash_flow_spec.rb
241
280
  - spec/iex/endpoints/chart_spec.rb
242
281
  - spec/iex/endpoints/company_spec.rb
243
282
  - spec/iex/endpoints/crypto_spec.rb
244
283
  - spec/iex/endpoints/dividends_spec.rb
245
284
  - spec/iex/endpoints/earnings_spec.rb
285
+ - spec/iex/endpoints/historical_prices_spec.rb
246
286
  - spec/iex/endpoints/income_spec.rb
247
287
  - spec/iex/endpoints/key_stats_spec.rb
248
288
  - spec/iex/endpoints/largest_trades_spec.rb
@@ -251,7 +291,9 @@ files:
251
291
  - spec/iex/endpoints/ohlc_spec.rb
252
292
  - spec/iex/endpoints/price_spec.rb
253
293
  - spec/iex/endpoints/quote_spec.rb
294
+ - spec/iex/endpoints/ref_data_spec.rb
254
295
  - spec/iex/endpoints/sectors_spec.rb
296
+ - spec/iex/endpoints/stock_market_spec.rb
255
297
  - spec/iex/resources/resource_spec.rb
256
298
  - spec/iex/version_spec.rb
257
299
  - spec/spec_helper.rb
@@ -261,7 +303,7 @@ homepage: http://github.com/dblock/iex-ruby-client
261
303
  licenses:
262
304
  - MIT
263
305
  metadata: {}
264
- post_install_message:
306
+ post_install_message:
265
307
  rdoc_options: []
266
308
  require_paths:
267
309
  - lib
@@ -269,19 +311,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
269
311
  requirements:
270
312
  - - ">="
271
313
  - !ruby/object:Gem::Version
272
- version: '0'
314
+ version: 2.3.0
273
315
  required_rubygems_version: !ruby/object:Gem::Requirement
274
316
  requirements:
275
317
  - - ">="
276
318
  - !ruby/object:Gem::Version
277
319
  version: 1.3.6
278
320
  requirements: []
279
- rubyforge_project:
280
- rubygems_version: 2.6.14.1
281
- signing_key:
321
+ rubygems_version: 3.0.3
322
+ signing_key:
282
323
  specification_version: 4
283
324
  summary: IEX Finance API Ruby client with support for retrieving stock quotes.
284
325
  test_files:
326
+ - spec/fixtures/iex/advanced_stats/invalid.yml
327
+ - spec/fixtures/iex/advanced_stats/msft.yml
328
+ - spec/fixtures/iex/balance_sheet/invalid.yml
329
+ - spec/fixtures/iex/balance_sheet/msft.yml
330
+ - spec/fixtures/iex/cash_flow/invalid.yml
331
+ - spec/fixtures/iex/cash_flow/msft.yml
285
332
  - spec/fixtures/iex/chart/1d.yml
286
333
  - spec/fixtures/iex/chart/20190306.yml
287
334
  - spec/fixtures/iex/chart/bad_option.yml
@@ -300,8 +347,17 @@ test_files:
300
347
  - spec/fixtures/iex/dividends/msft_invalid_range.yml
301
348
  - spec/fixtures/iex/earnings/invalid.yml
302
349
  - spec/fixtures/iex/earnings/msft.yml
350
+ - spec/fixtures/iex/historical_prices/abcd.yml
351
+ - spec/fixtures/iex/historical_prices/invalid.yml
352
+ - spec/fixtures/iex/historical_prices/invalid_date.yml
353
+ - spec/fixtures/iex/historical_prices/invalid_range.yml
354
+ - spec/fixtures/iex/historical_prices/msft.yml
355
+ - spec/fixtures/iex/historical_prices/msft_5d.yml
356
+ - spec/fixtures/iex/historical_prices/msft_date_and_chart_by_day.yml
357
+ - spec/fixtures/iex/historical_prices/msft_specific_date_trimmed.yml
303
358
  - spec/fixtures/iex/income/invalid.yml
304
359
  - spec/fixtures/iex/income/msft.yml
360
+ - spec/fixtures/iex/income/nsrgy.yml
305
361
  - spec/fixtures/iex/key_stats/invalid.yml
306
362
  - spec/fixtures/iex/key_stats/msft.yml
307
363
  - spec/fixtures/iex/largest-trades/aapl.yml
@@ -316,15 +372,25 @@ test_files:
316
372
  - spec/fixtures/iex/price/msft.yml
317
373
  - spec/fixtures/iex/quote/invalid.yml
318
374
  - spec/fixtures/iex/quote/msft.yml
375
+ - spec/fixtures/iex/ref-data/isin.yml
376
+ - spec/fixtures/iex/ref-data/isin_mapped.yml
377
+ - spec/fixtures/iex/ref-data/symbols.yml
378
+ - spec/fixtures/iex/ref-data/wrong_isin_mapped.yml
319
379
  - spec/fixtures/iex/sectors/invalid.yml
320
380
  - spec/fixtures/iex/sectors/sectors-performance.yml
381
+ - spec/fixtures/iex/stock_market/list_mostactive.yml
321
382
  - spec/iex/client_spec.rb
322
- - spec/iex/config_spec.rb
383
+ - spec/iex/config/client_spec.rb
384
+ - spec/iex/config/logger_spec.rb
385
+ - spec/iex/endpoints/advanced_stats_spec.rb
386
+ - spec/iex/endpoints/balance_sheet_spec.rb
387
+ - spec/iex/endpoints/cash_flow_spec.rb
323
388
  - spec/iex/endpoints/chart_spec.rb
324
389
  - spec/iex/endpoints/company_spec.rb
325
390
  - spec/iex/endpoints/crypto_spec.rb
326
391
  - spec/iex/endpoints/dividends_spec.rb
327
392
  - spec/iex/endpoints/earnings_spec.rb
393
+ - spec/iex/endpoints/historical_prices_spec.rb
328
394
  - spec/iex/endpoints/income_spec.rb
329
395
  - spec/iex/endpoints/key_stats_spec.rb
330
396
  - spec/iex/endpoints/largest_trades_spec.rb
@@ -333,7 +399,9 @@ test_files:
333
399
  - spec/iex/endpoints/ohlc_spec.rb
334
400
  - spec/iex/endpoints/price_spec.rb
335
401
  - spec/iex/endpoints/quote_spec.rb
402
+ - spec/iex/endpoints/ref_data_spec.rb
336
403
  - spec/iex/endpoints/sectors_spec.rb
404
+ - spec/iex/endpoints/stock_market_spec.rb
337
405
  - spec/iex/resources/resource_spec.rb
338
406
  - spec/iex/version_spec.rb
339
407
  - spec/spec_helper.rb
@@ -1,45 +0,0 @@
1
- module IEX
2
- module Api
3
- module Config
4
- extend self
5
-
6
- ATTRIBUTES = %i[
7
- proxy
8
- user_agent
9
- ca_path
10
- ca_file
11
- logger
12
- timeout
13
- open_timeout
14
- endpoint
15
- publishable_token
16
- ].freeze
17
-
18
- attr_accessor(*Config::ATTRIBUTES)
19
-
20
- def reset!
21
- self.endpoint = 'https://cloud.iexapis.com/v1'
22
- self.publishable_token = ENV['IEX_API_PUBLISHABLE_TOKEN']
23
- self.user_agent = "IEX Ruby Client/#{IEX::VERSION}"
24
- self.ca_path = defined?(OpenSSL) ? OpenSSL::X509::DEFAULT_CERT_DIR : nil
25
- self.ca_file = defined?(OpenSSL) ? OpenSSL::X509::DEFAULT_CERT_FILE : nil
26
- self.proxy = nil
27
- self.logger = nil
28
- self.timeout = nil
29
- self.open_timeout = nil
30
- end
31
- end
32
-
33
- class << self
34
- def configure
35
- block_given? ? yield(Config) : Config
36
- end
37
-
38
- def config
39
- Config
40
- end
41
- end
42
- end
43
- end
44
-
45
- IEX::Api::Config.reset!