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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ac37be4f80052239b7f94fbec8d7fd92448c17a
4
- data.tar.gz: 4fcb0a16a81cef7025271542655c75419a10b63a
3
+ metadata.gz: a949bcae06834071c1f42ada357a2a8069a3199e
4
+ data.tar.gz: 475bf73cc85629c0bac27d7d6a860207bf55485c
5
5
  SHA512:
6
- metadata.gz: 5071c8726d577c7f78778069527f3926fc0322b6a4e0b2b73aecc49807c8a2e4b9840a0db9f336add9ff625d0610285c1313a2ed99a81825552f648564e87e76
7
- data.tar.gz: cd44fbb500ee5455487f33885ff934e9d9b1c53d05223089279b344ba8f5dad667159e5c1e2b8d5d286b980eaa930ef758a8d4987808b9adfd7754e26e9e1906
6
+ metadata.gz: 1668dd59eaf982e5c501b3c9032a9a2efe7729f85f0ff0ca78d2357ac4f8fab89e847b73912da070afc64526ec817d1a60353d9cf948c4f68a64672cbc089e98
7
+ data.tar.gz: c4b0492851f494973bcf135852719c4ebb8b9e1ce3ab38d6ed2796afa21ee70fe2c4444195596bfb8563bad94e679bc729caac1a52eb0c384e9954dc07e92543
@@ -222,7 +222,9 @@ class Yfinance
222
222
  callback.call(result_hash)
223
223
  end
224
224
  elsif response.code == 404
225
- raise SymbolNotFoundException.new("#{symbol} not found at Yahoo")
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
@@ -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
@@ -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.12"
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.12
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-19 00:00:00.000000000 Z
11
+ date: 2014-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler