brm_finance 1.0.2 → 1.0.3

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: 25f43763e0fc8369ed317f36037380335a952fb7
4
- data.tar.gz: 7e4f0b2f54055d7cbaf21d7dffa722448fc6fe5f
3
+ metadata.gz: d4e9906f832f22899b6d5ef19717e52a2d9a0de5
4
+ data.tar.gz: 7f66575daef2292c966d9c00038486a5c16dadfb
5
5
  SHA512:
6
- metadata.gz: 773e1c5396dd208da4e96c712ab52478778c87926cf364ae949d520eac671d4aadda67917d9c19d89f59b5e319b1f6285e4bf622a83c19901da1ebe20acaf826
7
- data.tar.gz: 1e99f972efbe5186be96c789af8f109a2f6479c6546336835e7d79771cfce57deb1a812e2a4afad5368de70979a77f98ded039dc0698aef7fec0e777d7195783
6
+ metadata.gz: c2b31259db5beb974ecb6432c16552b25393653e46ab2a5f0bf5f51691d4c213fba7ecf2843d050e0880222ffcaea6dc12861dd11258ddf4777c6d4995e6eafe
7
+ data.tar.gz: c50a284a6f6b4473b8c0ee7588736b4f79e97f4e9f61b7a03989ee6aacb7f9e2a8aa595fcdc5717f32c580494ac28786e133afd1cbea4e248a2ce67edf50bd25
Binary file
@@ -132,13 +132,21 @@ module BrmFinance
132
132
  end
133
133
 
134
134
  def self.history(symbol, start_date='2012-01-01', end_date=Date.today.strftime('%Y-%m-%d'))
135
+ symbol = symbol.is_a?(Array) ? symbol : [symbol]
136
+
135
137
  results = []
136
- (start_date.to_date..end_date.to_date+1.year).step(365) do |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'))
138
+ results = symbol.collect do |sym|
139
+ series = []
140
+ (start_date.to_date..end_date.to_date+1.year).step(365) do |date|
141
+ break if date > Date.today
142
+ series += self.quote(symbol, (date).strftime('%Y-%m-%d'), (date + 1.year - 1.day).strftime('%Y-%m-%d'))
143
+ end
144
+
145
+ {'Symbol' => symbol, 'Series': series.uniq}
139
146
  end
140
147
 
141
- results.uniq
148
+ results
149
+ end
142
150
  end
143
151
  end
144
152
  end
@@ -1,3 +1,3 @@
1
1
  module BrmFinance
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
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.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Adamson, Ty Rauber
@@ -109,6 +109,7 @@ files:
109
109
  - LICENSE
110
110
  - brm_finance-1.0.0.gem
111
111
  - brm_finance-1.0.1.gem
112
+ - brm_finance-1.0.2.gem
112
113
  - brm_finance.gemspec
113
114
  - lib/.DS_Store
114
115
  homepage: https://github.com/aadamson/brm_finance