watcard 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: d2bbcede77261b23a5ce0fa61a6b559afb7aaac7
4
- data.tar.gz: e24ce3df5490d72ecec90ba9ebc7e2fbe61a8d53
3
+ metadata.gz: ac661ac3398c22b4ca3dd077f04be700df151ece
4
+ data.tar.gz: 2aa6197bba42ab4888d4885ba5523fe88f401b95
5
5
  SHA512:
6
- metadata.gz: 416101087dcef732329cea8e8ec87385c21234aea4eaa6ed14e13847a4e488ad1918272064f0c8a898c0c9f2c91806384e46370ee2428790f88c6761462a7c1c
7
- data.tar.gz: 459b8fd2d3ee391f8e3cd48875e7d618c23055f9c2fae0a5d8c72a8834e1979a12bd2cdd7b9a37b163e0b8368c5d83be6527bd54fc696886e2383a2d26bf9d74
6
+ metadata.gz: ee8303d6c68a842374145c24c0b2d50e492babc43d85233bffbac926e8b9d09940570073bb0a36ca41de4d7e082707b140d4e1b211595ee92953b397651a1e9a
7
+ data.tar.gz: 7a9a85d84d904eeccc099647edc390dfae49f8a57c52e4ebaf94fb315c7d03ab8e06877ceddb5970b5da1e692579291d33218984c96eede52a004096ffc730b2
@@ -104,10 +104,7 @@ module Watcard
104
104
 
105
105
  def fetch_meals(days_ago)
106
106
  hist = history(Time.now.less(days_ago, :days))
107
- if hist.empty?
108
- log "No Transactions"
109
- exit
110
- end
107
+ return hist if hist.empty?
111
108
  add_transaction_types(hist)
112
109
  bundle_transactions(hist)
113
110
  end
@@ -148,6 +145,7 @@ END
148
145
 
149
146
  def output_ledger_all
150
147
  start = (Date.today - last_ledger_add).to_i - 1
148
+ puts "# Fetching transactions since #{start} days ago"
151
149
  days = []
152
150
  start.downto(0).each do |days_ago|
153
151
  days << ledger_transactions(days_ago)
@@ -159,6 +157,7 @@ END
159
157
 
160
158
  def output_history(days_ago)
161
159
  meals = fetch_meals(days_ago)
160
+ puts "No Transactions" if meals.empty?
162
161
  total = 0
163
162
  meals.each do |m|
164
163
  total += m[:amount] if m[:balance] == 1
@@ -1,3 +1,3 @@
1
1
  module Watcard
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watcard
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
  - Tristan Hume