yfinance 1.0.12 → 1.0.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/lib/yfinance.rb +3 -1
- data/test/yfinance_test.rb +9 -1
- data/yfinance.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a949bcae06834071c1f42ada357a2a8069a3199e
|
4
|
+
data.tar.gz: 475bf73cc85629c0bac27d7d6a860207bf55485c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1668dd59eaf982e5c501b3c9032a9a2efe7729f85f0ff0ca78d2357ac4f8fab89e847b73912da070afc64526ec817d1a60353d9cf948c4f68a64672cbc089e98
|
7
|
+
data.tar.gz: c4b0492851f494973bcf135852719c4ebb8b9e1ce3ab38d6ed2796afa21ee70fe2c4444195596bfb8563bad94e679bc729caac1a52eb0c384e9954dc07e92543
|
data/lib/yfinance.rb
CHANGED
@@ -222,7 +222,9 @@ class Yfinance
|
|
222
222
|
callback.call(result_hash)
|
223
223
|
end
|
224
224
|
elsif response.code == 404
|
225
|
-
|
225
|
+
result_hash = { symbol => "#{symbol} not found at Yahoo" }
|
226
|
+
callback.call(result_hash)
|
227
|
+
# raise SymbolNotFoundException.new("#{symbol} not found at Yahoo")
|
226
228
|
else
|
227
229
|
raise YahooFinanceException.new("Error communicating with Yahoo. Response code #{ response.code }. URL: " + "#{ url }. Response: #{ response.inspect }")
|
228
230
|
end
|
data/test/yfinance_test.rb
CHANGED
@@ -46,7 +46,7 @@ class YfinanceTest < Minitest::Test
|
|
46
46
|
assert_equal 3, res.length
|
47
47
|
assert_nil res["BCXZA"]
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
def test_historical_data_works_for_one_symbol
|
51
51
|
yf = Yfinance.new
|
52
52
|
res = Proc.new { |resp| assert resp["MSFT"].kind_of?(Array)}
|
@@ -71,4 +71,12 @@ class YfinanceTest < Minitest::Test
|
|
71
71
|
yf.daily_historical_data_callback(symbols, Date.today - 7, Date.today, &res)
|
72
72
|
end
|
73
73
|
|
74
|
+
def test_historical_data_works_for_invalid_symbols
|
75
|
+
yf = Yfinance.new
|
76
|
+
symbols = ["MSFT", "asdfbc", "TWTR"]
|
77
|
+
result = yf.daily_historical_data(symbols, Date.today - 7, Date.today)
|
78
|
+
assert_equal symbols.length, result.length
|
79
|
+
assert result["ASDFBC"].kind_of?(String)
|
80
|
+
end
|
81
|
+
|
74
82
|
end
|
data/yfinance.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'yfinance'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "yfinance"
|
8
|
-
spec.version = "1.0.
|
8
|
+
spec.version = "1.0.13"
|
9
9
|
spec.authors = ["Alexander Potrykus"]
|
10
10
|
spec.email = ["alexander@risklog.io"]
|
11
11
|
spec.summary = %q{Fetches Yahoo! Finance data using parallel HTTP requests.}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yfinance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Potrykus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|