ledger_get_prices 0.0.5 → 0.0.6

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: df93f6b4d3b0cbb1499b5e2ba71d4d7da579ed14
4
- data.tar.gz: a38c1fed89a187f41f6f97139134c8cc452cdc8e
3
+ metadata.gz: 1e5ce2966b7c715cce97c872e0e1ea75345ec5e9
4
+ data.tar.gz: 217adb96cbfb8dd4c8d85b70604d2b1e6c59adc7
5
5
  SHA512:
6
- metadata.gz: 35aec042949d4bac7a20e76be89d3755e115a9163f653152c7281d44d59bd49f98983e26de845948e91bf842ef4643a96c89272206d19ea6779828cbe8593ce4
7
- data.tar.gz: 138e7a9c9699432aaf5a87fb02e3e4f02c8c7fd3080f6be1f2018b886381c4146ad1790f314df3b4adbdb2fd64f33c25bf4d12c9f118b83e4d5e9d1017919194
6
+ metadata.gz: 8389c66f9674e1ae505867b16261b14de24bd6a28fdaf27592078dc488a6a99ed15a68f8b1936a256e00528ebd92c114ad7d5205771f34aff633236c7baf72bd
7
+ data.tar.gz: ba93a69c1f07fb34ab3fc9a14af2266b9a9f5b0ccdc86768d90ad362f6ba688e1267c8b050d2bfc6fae3633269bffe13c1716e58cb412c449226ee9ddca70c82
@@ -32,7 +32,7 @@ module LedgerGetPrices
32
32
  PRICE_DB_PATH = ENV['LEDGER_PRICE_DB'] || ENV['PRICE_HIST'] # PRICE_HIST is <v3
33
33
  DATE_FORMAT = ENV['LEDGER_PRICE_DATE_FORMAT'] || "%Y/%m/%d"
34
34
  PRICE_FORMAT = "P %{date} %{time} %{symbol} %{price}"
35
- COMMODITY_BLACKLIST = (ENV['LEDGER_PRICE_COMMODITY_BLACKLIST'] || 'BTC').split(" ")
35
+ COMMODITY_BLACKLIST = (ENV['LEDGER_PRICE_COMMODITY_BLACKLIST'] || '').split(" ")
36
36
 
37
37
  # With a bang because it does a file write.
38
38
  def run!
@@ -65,8 +65,6 @@ module LedgerGetPrices
65
65
  if COMMODITY_BLACKLIST.include?(symbol)
66
66
  puts "Skipping #{symbol}: blacklisted."
67
67
  puts "Use `LEDGER_PRICE_COMMODITY_BLACKLIST` to configure the blacklist."
68
- puts "BTC is included by default because yahoo doesn't provide a way to " +
69
- "get historical data for it."
70
68
  return []
71
69
  end
72
70
 
@@ -125,12 +123,15 @@ module LedgerGetPrices
125
123
  # @return [Array<String>] Possible Yahoo finance compatible quote strings
126
124
  def possible_quote_strings(commodity: nil)
127
125
  raise "No commodity given" if commodity.nil?
126
+ # We get all quotes in USD
128
127
  ["#{commodity}=X", "USD#{commodity}=X", "#{commodity}"]
129
128
  end
130
129
 
131
130
  def commodities
132
131
  # All the commodities we care about.
133
132
  @commodities ||= `ledger commodities`.split("\n").reject { |x| x == "$" }.tap do |c|
133
+ # Since all quotes will be in USD, we don't need to bother
134
+ # retrieving USD/USD quotes.
134
135
  c << BASE_CURRENCY if BASE_CURRENCY != 'USD'
135
136
  end
136
137
  end
@@ -1,3 +1,3 @@
1
1
  module LedgerGetPrices
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ledger_get_prices
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Kot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-05 00:00:00.000000000 Z
11
+ date: 2016-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler