brm_finance 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac7b1e200722d4e1e48c75c332cfe845b341deda
4
- data.tar.gz: 52e8290d8b50bd55bf90ed766afc58644fccc7be
3
+ metadata.gz: 59268a52987945e2a882f6f8c54e72d03d2347a2
4
+ data.tar.gz: 1489e10158bc187f6880823343962cb387da1732
5
5
  SHA512:
6
- metadata.gz: b4df41e0719b028d790817b53892f0392903e5fa8feb0d4c7e5c5617a156fba62e252ad0142bd7a600fb3fe96feffc9fe6cc8f640529b7c4678a146a3a076a0e
7
- data.tar.gz: e0b43e391930114fc1ce939dd20a11b403f083982e8553f386fa5d744c060111181892e5da257dc22ff08dcf5e8741e1687ab70d60701342ca8691df4acd3559
6
+ metadata.gz: d3543fed071ed87ec6dd5b31811818f99ae28b85381d8760a918189e5b8494e9fdc80e3d6db728d3630549d01575c370859e36c26fe6689a5d4e671dcf2b2068
7
+ data.tar.gz: 76d937a3bbe3e73cee734083077d88c1039d8026ada7a78697d611c007cb702b0ccdd42372347dbe57addfd3deccaebcb55957eb0cb1286a84392408cc3ebeec
@@ -76,13 +76,15 @@ module BrmFinance
76
76
  self.parse(response, symbol)
77
77
  end
78
78
 
79
- def self.dividends_splits(symbol, start_date='2000-01-01', end_date=Date.today.strftime('%Y-%m-%d'))
79
+ def self.dividends_splits(symbol, start_date=Date.today-1.year, end_date=Date.today)
80
80
  symbol = [symbol] unless symbol.is_a?(Array)
81
81
 
82
- start_date = start_date.split('-')
83
- start_date = "a=#{start_date[1]}&b=#{start_date[2]}&c=#{start_date[0]}"
82
+ start_date = start_date.strftime('%m-%d-%Y')split('-')
83
+ start_date = "a=#{start_date[0]}&b=#{start_date[1]}&c=#{start_date[2]}"
84
+
85
+ end_date = end_date.strftime('%m-%d-%Y')split('-')
84
86
  end_date = end_date.split('-')
85
- end_date = "d=#{end_date[1]}&e=#{end_date[2]}&f=#{end_date[0]}"
87
+ end_date = "d=#{end_date[0]}&e=#{end_date[1]}&f=#{end_date[2]}"
86
88
 
87
89
  results = []
88
90
  symbol.each do |s|
@@ -131,13 +133,13 @@ module BrmFinance
131
133
  #return results
132
134
  end
133
135
 
134
- def self.history(symbol, start_date='2012-01-01', end_date=Date.today.strftime('%Y-%m-%d'))
136
+ def self.history(symbol, start_date=Date.today - 1.year, end_date=Date.today)
135
137
  symbol = symbol.is_a?(Array) ? symbol : [symbol]
136
138
 
137
139
  results = []
138
140
  results = symbol.collect do |sym|
139
141
  series = []
140
- (start_date.to_date..end_date.to_date+1.year).step(365) do |date|
142
+ (start_date.end_date+1.year).step(365) do |date|
141
143
  break if date > Date.today
142
144
  new_series = self.quote(sym, (date).strftime('%Y-%m-%d'), (date + 1.year - 1.day).strftime('%Y-%m-%d'))
143
145
 
@@ -1,3 +1,3 @@
1
1
  module BrmFinance
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brm_finance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Adamson, Ty Rauber