brm_finance 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/brm_finance-1.0.1.gem +0 -0
- data/lib/brm_finance/stock.rb +3 -4
- data/lib/brm_finance/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25f43763e0fc8369ed317f36037380335a952fb7
|
4
|
+
data.tar.gz: 7e4f0b2f54055d7cbaf21d7dffa722448fc6fe5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 773e1c5396dd208da4e96c712ab52478778c87926cf364ae949d520eac671d4aadda67917d9c19d89f59b5e319b1f6285e4bf622a83c19901da1ebe20acaf826
|
7
|
+
data.tar.gz: 1e99f972efbe5186be96c789af8f109a2f6479c6546336835e7d79771cfce57deb1a812e2a4afad5368de70979a77f98ded039dc0698aef7fec0e777d7195783
|
Binary file
|
data/lib/brm_finance/stock.rb
CHANGED
@@ -64,7 +64,6 @@ module BrmFinance
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def self.quote(symbol, start_date=nil, end_date=nil)
|
67
|
-
'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.historicaldata%20where%20symbol%20%3D%20%22YHOO%22%20and%20startDate%20%3D%20%222009-09-11%22%20and%20endDate%20%3D%20%222010-03-10%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback='
|
68
67
|
url = 'http://query.yahooapis.com/v1/public/yql?q=';
|
69
68
|
if start_date && end_date
|
70
69
|
url = url+URI::encode("select * from yahoo.finance.historicaldata where symbol in (#{symbol.to_p}) and startDate = '#{start_date}' and endDate = '#{end_date}'")
|
@@ -135,11 +134,11 @@ module BrmFinance
|
|
135
134
|
def self.history(symbol, start_date='2012-01-01', end_date=Date.today.strftime('%Y-%m-%d'))
|
136
135
|
results = []
|
137
136
|
(start_date.to_date..end_date.to_date+1.year).step(365) do |date|
|
138
|
-
break if date
|
139
|
-
results += self.quote(symbol, (date
|
137
|
+
break if date > Date.today
|
138
|
+
results += self.quote(symbol, (date).strftime('%Y-%m-%d'), (date + 1.year - 1.day).strftime('%Y-%m-%d'))
|
140
139
|
end
|
141
140
|
|
142
|
-
results
|
141
|
+
results.uniq
|
143
142
|
end
|
144
143
|
end
|
145
144
|
end
|
data/lib/brm_finance/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brm_finance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Adamson, Ty Rauber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- .DS_Store
|
109
109
|
- LICENSE
|
110
110
|
- brm_finance-1.0.0.gem
|
111
|
+
- brm_finance-1.0.1.gem
|
111
112
|
- brm_finance.gemspec
|
112
113
|
- lib/.DS_Store
|
113
114
|
homepage: https://github.com/aadamson/brm_finance
|