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 +4 -4
- data/lib/yfinance.rb +2 -1
- data/test/yfinance_test.rb +29 -22
- data/yfinance.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6081df5e4c221a9bae6d3b82a0f8bed85e064119
|
4
|
+
data.tar.gz: 89d893ee6c3463e2194510968e405c15a887149a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 466d7662b84676abf4e093b876ab29d5c38f911d97c1c899444f65acafad9ef0b06c127683f7c4f61b3145d2896b2a440a3da5e1f92984bdf229e97f1ce87bbf
|
7
|
+
data.tar.gz: 5068cf05ad2ecaca9d626376c9aff810ae52b0daaee0a171a59d28765284c32a40a6d426ac2bebd74b34832610a9bcba4330e02a9ccde7db100ee237a86de8b7
|
data/lib/yfinance.rb
CHANGED
@@ -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.
|
189
|
+
result.delete_at(0)
|
190
|
+
result.delete_at(0)
|
190
191
|
callback.call(result)
|
191
192
|
end
|
192
193
|
elsif response.code == 404
|
data/test/yfinance_test.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
require 'test_helper.rb'
|
2
2
|
|
3
3
|
class YfinanceTest < Minitest::Test
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
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.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.}
|