brm_finance 1.0.1 → 1.0.2

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: 4c62e2bb9375c13be790efcc0bc5c1b9195c5050
4
- data.tar.gz: 53ba9ca7ca4d234366111a5081fed99070c262f6
3
+ metadata.gz: 25f43763e0fc8369ed317f36037380335a952fb7
4
+ data.tar.gz: 7e4f0b2f54055d7cbaf21d7dffa722448fc6fe5f
5
5
  SHA512:
6
- metadata.gz: 13923f0054942dfe1479d44c16124bedf26a6624ce083e622cef9dd126ea68303aa9bd8e3ecafdded831f9d08623211493ee8aedbd57b75620ab5b5393f367a6
7
- data.tar.gz: 774b119e2f3a1502966cba9830b177cd09677daff44256388894f7651a66ddaf31c8054c728722945719ae995d4dcdd01d99797c986c1cf4880a489cf83bfa92
6
+ metadata.gz: 773e1c5396dd208da4e96c712ab52478778c87926cf364ae949d520eac671d4aadda67917d9c19d89f59b5e319b1f6285e4bf622a83c19901da1ebe20acaf826
7
+ data.tar.gz: 1e99f972efbe5186be96c789af8f109a2f6479c6546336835e7d79771cfce57deb1a812e2a4afad5368de70979a77f98ded039dc0698aef7fec0e777d7195783
Binary file
@@ -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 + 1.day > Date.today
139
- results += self.quote(symbol, (date + 1.day).strftime('%Y-%m-%d'), (date + 1.year).strftime('%Y-%m-%d'))
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
@@ -1,3 +1,3 @@
1
1
  module BrmFinance
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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-15 00:00:00.000000000 Z
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