eodhd 0.19.11 → 0.19.13
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/CHANGELOG +16 -0
- data/eodhd.gemspec +5 -5
- data/lib/Eodhd/VERSION.rb +1 -1
- data/lib/Eodhd/WebSocketClient.rb +4 -4
- data/test/Eodhd/WebSocketClient_test.rb +40 -0
- data/test/gemspec_test.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: debc917c46b895d48892c6fdb0d0845c980fe26e0be451230e62594329083308
|
|
4
|
+
data.tar.gz: 00a5e08410c0a4791be2b87f9392c94958e9eea54b7204c8f86ef8814280aec6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c15a73dd3d5255dc193f7cd02705d5df4df606e8f016bfbccbafbc9e5a05322d23a1c08864ef0d8ca4353a8ae409db40dbed07769a37412ada78344dccb46714
|
|
7
|
+
data.tar.gz: e0ae570d9434bc3b83e2f9bbf2ff80ce8076544f0b50b93d044fde186f398b3cab85dd48193480c37e51bd6f4638960e38537b701566d5ac717532a4945b2d5f
|
data/CHANGELOG
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
# eodhd/CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 20261024
|
|
4
|
+
|
|
5
|
+
0.19.13: Fix WebSocketClient.us_trade, .us_quote, .forex and .crypto.
|
|
6
|
+
|
|
7
|
+
1. ~ Eodhd::WebSocketClient.us_trade, .us_quote, .forex and .crypto: /self.class.new/new/. Within class << self, self.class is Class, so each raised TypeError.
|
|
8
|
+
2. + test/Eodhd/WebSocketClient_test.rb: that .us_trade, .us, .us_quote, .forex and .crypto each make a client for their stream.
|
|
9
|
+
3. ~ Eodhd::VERSION: /0.19.12/0.19.13/
|
|
10
|
+
|
|
11
|
+
|
|
3
12
|
## 20261021
|
|
4
13
|
|
|
14
|
+
0.19.12: Require http.rb >= 1.7.0, for case-sensitive filesystems.
|
|
15
|
+
|
|
16
|
+
1. ~ eodhd.gemspec and eodhd.rb.gemspec: spec.dependencies: /http.rb/http.rb >= 1.7.0/. Before 1.7.0 http.rb's load file is lib/HTTP.rb, which Eodhd::Client's require 'http.rb' finds only on a case-insensitive filesystem.
|
|
17
|
+
2. ~ eodhd.gemspec and eodhd.rb.gemspec: spec.dependencies: /%w{}/[]/, so as a requirement can be given.
|
|
18
|
+
3. + test/gemspec_test.rb: that each gemspec requires http.rb >= 1.7.0.
|
|
19
|
+
4. ~ Eodhd::VERSION: /0.19.11/0.19.12/
|
|
20
|
+
|
|
5
21
|
0.19.11: Put the WebMock shim in a method, as in http.rb.
|
|
6
22
|
|
|
7
23
|
1. ~ test/helper.rb: + skip_webmocks_http_rb_adapter(), holding the webmock shim.
|
data/eodhd.gemspec
CHANGED
|
@@ -36,11 +36,11 @@ Gem::Specification.new do |spec|
|
|
|
36
36
|
'README.md',
|
|
37
37
|
].flatten
|
|
38
38
|
|
|
39
|
-
spec.dependencies =
|
|
40
|
-
http.rb
|
|
41
|
-
iodine
|
|
42
|
-
logger
|
|
43
|
-
|
|
39
|
+
spec.dependencies = [
|
|
40
|
+
['http.rb', '>= 1.7.0'],
|
|
41
|
+
'iodine',
|
|
42
|
+
'logger',
|
|
43
|
+
]
|
|
44
44
|
|
|
45
45
|
spec.development_dependencies = %w{
|
|
46
46
|
rake
|
data/lib/Eodhd/VERSION.rb
CHANGED
|
@@ -63,20 +63,20 @@ class Eodhd
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def us_trade(api_token:, symbols:, consumer:)
|
|
66
|
-
|
|
66
|
+
new(api_token: api_token, asset_class: 'us', symbols: symbols, consumer: consumer)
|
|
67
67
|
end
|
|
68
68
|
alias_method :us, :us_trade
|
|
69
69
|
|
|
70
70
|
def us_quote(api_token:, symbols:, consumer:)
|
|
71
|
-
|
|
71
|
+
new(api_token: api_token, asset_class: 'us-quote', symbols: symbols, consumer: consumer)
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
def forex(api_token:, symbols:, consumer:)
|
|
75
|
-
|
|
75
|
+
new(api_token: api_token, asset_class: 'forex', symbols: symbols, consumer: consumer)
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def crypto(api_token:, symbols:, consumer:)
|
|
79
|
-
|
|
79
|
+
new(api_token: api_token, asset_class: 'crypto', symbols: symbols, consumer: consumer)
|
|
80
80
|
end
|
|
81
81
|
end # class << self
|
|
82
82
|
|
|
@@ -6,6 +6,46 @@ describe Eodhd::WebSocketClient do
|
|
|
6
6
|
let(:api_token){ENV.fetch('EODHD_API_TOKEN', '<API_TOKEN>')}
|
|
7
7
|
let(:consumer){->(data){}}
|
|
8
8
|
|
|
9
|
+
describe ".us_trade" do
|
|
10
|
+
it "makes a client for the US trade stream" do
|
|
11
|
+
client = Eodhd::WebSocketClient.us_trade(api_token: api_token, symbols: 'AAPL', consumer: consumer)
|
|
12
|
+
_(client).must_be_instance_of(Eodhd::WebSocketClient)
|
|
13
|
+
_(client.asset_class).must_equal('us')
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
describe ".us" do
|
|
18
|
+
it "makes a client for the US trade stream" do
|
|
19
|
+
client = Eodhd::WebSocketClient.us(api_token: api_token, symbols: 'AAPL', consumer: consumer)
|
|
20
|
+
_(client).must_be_instance_of(Eodhd::WebSocketClient)
|
|
21
|
+
_(client.asset_class).must_equal('us')
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
describe ".us_quote" do
|
|
26
|
+
it "makes a client for the US quote stream" do
|
|
27
|
+
client = Eodhd::WebSocketClient.us_quote(api_token: api_token, symbols: 'AAPL', consumer: consumer)
|
|
28
|
+
_(client).must_be_instance_of(Eodhd::WebSocketClient)
|
|
29
|
+
_(client.asset_class).must_equal('us-quote')
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
describe ".forex" do
|
|
34
|
+
it "makes a client for the forex stream" do
|
|
35
|
+
client = Eodhd::WebSocketClient.forex(api_token: api_token, symbols: 'EURUSD', consumer: consumer)
|
|
36
|
+
_(client).must_be_instance_of(Eodhd::WebSocketClient)
|
|
37
|
+
_(client.asset_class).must_equal('forex')
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
describe ".crypto" do
|
|
42
|
+
it "makes a client for the crypto stream" do
|
|
43
|
+
client = Eodhd::WebSocketClient.crypto(api_token: api_token, symbols: 'BTC-USD', consumer: consumer)
|
|
44
|
+
_(client).must_be_instance_of(Eodhd::WebSocketClient)
|
|
45
|
+
_(client.asset_class).must_equal('crypto')
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
9
49
|
describe "#initialize" do
|
|
10
50
|
it "accepts array of symbols and formats to comma-separated string" do
|
|
11
51
|
client = Eodhd::WebSocketClient.new(api_token: api_token, asset_class: 'us', symbols: ['AAPL', 'MSFT'], consumer: consumer)
|
data/test/gemspec_test.rb
CHANGED
|
@@ -26,6 +26,10 @@ require_relative './helper'
|
|
|
26
26
|
_(spec.runtime_dependencies.collect(&:name).sort).must_equal(%w{http.rb iodine logger})
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
it "requires http.rb 1.7.0 or later, whose load file is lib/http.rb" do
|
|
30
|
+
_(spec.runtime_dependencies.find{|dependency| dependency.name == 'http.rb'}.requirement.to_s).must_equal('>= 1.7.0')
|
|
31
|
+
end
|
|
32
|
+
|
|
29
33
|
it "declares its development dependencies" do
|
|
30
34
|
_(spec.development_dependencies.collect(&:name).sort).must_equal(%w{minitest minitest-mock minitest-spec-context rake simplecov vcr webmock})
|
|
31
35
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eodhd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.19.
|
|
4
|
+
version: 0.19.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thoran
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 1.7.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: 1.7.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: iodine
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|