bankscrap 2.0.0 → 2.0.1

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: 7e9fea8d54632ad5388ccd2cd6075fbe0dd69bcc
4
- data.tar.gz: 681e5691f14fbaa556502d5da1f16d4dff3b27be
3
+ metadata.gz: b5efc7e5d7389c86940e835e58f1e472a21c798e
4
+ data.tar.gz: fbe0edfb17bf2f8bd6a187a76b9dc526eb9fa493
5
5
  SHA512:
6
- metadata.gz: 23d25b06fbb967b07673077bb58cf8c214e1ab403fedfd511362c39d198923232c7d00473ae30b5b0731a45e3112e887ab23c696c4744405def72c3c4456e265
7
- data.tar.gz: d828191804b5f7e55ff58cd78da48ecaac34bb8687b01cb1459b2d42b5b55750ec3cc42a400e84772548255ef9a98e5cc8e1fb4b2af19e9eab1e4990072b41ae
6
+ metadata.gz: 1b157a5484ebc5246b58707278693d818b334da890460ad0cd9e4ae04a05bb524aecd215c005a3ea4ddaead74978294ce505ba51a641a9f59b6ea15135179058
7
+ data.tar.gz: 29ebadde8aaafd5f182f83649cefffdebb67002abd7dcbca896e35908e55fa3dfb2b756c51cc5de79f99d3e1f40a45189e5976cc0f9b8291edc7031a812f2e2d
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # 💸 Bankscrap 💸
2
2
 
3
3
  [![](http://188.166.39.57:3000/badge.svg)](http://188.166.39.57:3000)
4
+ ![build status](https://travis-ci.org/bankscrap/bankscrap.svg?branch=master)
4
5
 
5
6
  Ruby gem to extract account balance and transactions from banks. You can use it either as command line tool or as a library.
6
7
 
data/lib/bankscrap/cli.rb CHANGED
@@ -58,9 +58,8 @@ module Bankscrap
58
58
  export_to_file(transactions, options[:format], options[:output]) if options[:format]
59
59
 
60
60
  say "Transactions for: #{account.description} (#{account.iban})", :cyan
61
- transactions.each do |transaction|
62
- say transaction.to_s, (transaction.amount > Money.new(0) ? :green : :red)
63
- end
61
+ print_transactions_header
62
+ transactions.each { |t| print_transaction(t) }
64
63
  end
65
64
 
66
65
 
@@ -111,5 +110,22 @@ module Bankscrap
111
110
  exit
112
111
  end
113
112
  end
113
+
114
+ def print_transactions_header
115
+ say "\n"
116
+ say "DATE".ljust(13)
117
+ say "DESCRIPTION".ljust(50) + "\s\s\s"
118
+ say "AMOUNT".rjust(15) + "\s\s\s"
119
+ say "BALANCE".rjust(15)
120
+ say "-" * 99
121
+ end
122
+
123
+ def print_transaction(transaction)
124
+ color = (transaction.amount > Money.new(0) ? :green : :red)
125
+ say transaction.effective_date.strftime('%d/%m/%Y') + "\s\s\s"
126
+ say transaction.description.squish.truncate(50).ljust(50) + "\s\s\s", color
127
+ say transaction.amount.format.rjust(15) + "\s\s\s", color
128
+ say transaction.balance.format.rjust(15)
129
+ end
114
130
  end
115
131
  end
@@ -12,7 +12,7 @@ module Bankscrap
12
12
  end
13
13
 
14
14
  def to_s
15
- "#{effective_date.strftime('%d/%m/%Y')} #{description.ljust(45)} #{amount.format.rjust(20)}"
15
+ description
16
16
  end
17
17
 
18
18
  def to_a
@@ -1,3 +1,3 @@
1
1
  module Bankscrap
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bankscrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Cuevas
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-01 00:00:00.000000000 Z
12
+ date: 2016-06-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler