yfinance 1.0.5 → 1.0.6

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: abc150511a0860f83d0c1b596853e9b31f807062
4
- data.tar.gz: 6b9c44fc33058421190a7fad6f4f32533fdcd9dc
3
+ metadata.gz: 6081df5e4c221a9bae6d3b82a0f8bed85e064119
4
+ data.tar.gz: 89d893ee6c3463e2194510968e405c15a887149a
5
5
  SHA512:
6
- metadata.gz: d4cdd5b0fcf2936c00a22d4750a9cc2e90f9e7905eee7069b110fc29d8444100b760243342670792327e0525942b5be53bcf5fc6b7bf2cc731403af15a1e8825
7
- data.tar.gz: 64a929dce43e46df94d88734e6518e49c07737b426f9d6f94b76d3e6bb7c81ee873d9c5cbd193a32c6f1a1abe2120caabc7cb4a27f7ab427a1e3422e679282a6
6
+ metadata.gz: 466d7662b84676abf4e093b876ab29d5c38f911d97c1c899444f65acafad9ef0b06c127683f7c4f61b3145d2896b2a440a3da5e1f92984bdf229e97f1ce87bbf
7
+ data.tar.gz: 5068cf05ad2ecaca9d626376c9aff810ae52b0daaee0a171a59d28765284c32a40a6d426ac2bebd74b34832610a9bcba4330e02a9ccde7db100ee237a86de8b7
@@ -186,7 +186,8 @@ class Yfinance
186
186
  raise YahooFinanceException.new(" * Error: Unknown response body from Yahoo - #{ response.body[0..40] } ...")
187
187
  else
188
188
  result = CSV.parse(response.body, headers: cols).to_a
189
- result.delete(0)
189
+ result.delete_at(0)
190
+ result.delete_at(0)
190
191
  callback.call(result)
191
192
  end
192
193
  elsif response.code == 404
@@ -1,17 +1,17 @@
1
1
  require 'test_helper.rb'
2
2
 
3
3
  class YfinanceTest < Minitest::Test
4
- # def test_it_receives_quotes_for_valid_symbols
5
- # yf = Yfinance.new
6
- # res = yf.quotes(["AAPL", "TWTR"])
7
- # refute_empty res
8
- # end
9
- #
10
- # def test_it_work_for_an_invalid_symbol
11
- # yf = Yfinance.new
12
- # res = yf.quotes(["TWTR", "MADASDFASD", "AAPL"])
13
- # assert_equal res.length, 3
14
- # end
4
+ def test_it_receives_quotes_for_valid_symbols
5
+ yf = Yfinance.new
6
+ res = yf.quotes(["AAPL", "TWTR"])
7
+ refute_empty res
8
+ end
9
+
10
+ def test_it_work_for_an_invalid_symbol
11
+ yf = Yfinance.new
12
+ res = yf.quotes(["TWTR", "MADASDFASD", "AAPL"])
13
+ assert_equal res.length, 3
14
+ end
15
15
 
16
16
  def test_it_works_requesting_all_data_for_valid_symbols
17
17
  yf = Yfinance.new
@@ -19,16 +19,23 @@ class YfinanceTest < Minitest::Test
19
19
  assert_equal res.length, 3
20
20
  end
21
21
 
22
- # def test_it_works_requesting_all_data_for_one_invalid_symbol
23
- # yf = Yfinance.new
24
- # res = yf.quotes_all_info(["asdfasdfiajsodfi"])
25
- # assert_equal res[:name], "unknown symbol"
26
- # end
27
- #
28
- # def test_it_works_requesting_all_data_for_a_mix_of_valid_and_invalid__symbols
29
- # yf = Yfinance.new
30
- # res = yf.quotes_all_info(["AAPL", "asdfasdfiajsodfi", "MSFT"])
31
- # assert_equal res[:name], "unknown symbol"
32
- # end
22
+ def test_it_works_requesting_all_data_for_one_invalid_symbol
23
+ yf = Yfinance.new
24
+ res = yf.quotes_all_info(["asdfasdfiajsodfi"])
25
+ assert_equal res[:name], "unknown symbol"
26
+ end
27
+
28
+ def test_it_works_requesting_all_data_for_a_mix_of_valid_and_invalid__symbols
29
+ yf = Yfinance.new
30
+ res = yf.quotes_all_info(["AAPL", "asdfasdfiajsodfi", "MSFT"])
31
+ assert_equal res[:name], "unknown symbol"
32
+ end
33
+
34
+ def test_historical_data_works
35
+ yf = Yfinance.new
36
+ res = Proc.new { |resp| p resp }
37
+ yf.add_historical_data_query(['MSFT'], '2013-01-01', Date.today, {period: :daily}, &res)
38
+ yf.run
39
+ end
33
40
 
34
41
  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.5"
8
+ spec.version = "1.0.6"
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yfinance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Potrykus