bankscrap 2.0.0 → 2.0.1
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 +4 -4
- data/README.md +1 -0
- data/lib/bankscrap/cli.rb +19 -3
- data/lib/bankscrap/transaction.rb +1 -1
- data/lib/bankscrap/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5efc7e5d7389c86940e835e58f1e472a21c798e
|
4
|
+
data.tar.gz: fbe0edfb17bf2f8bd6a187a76b9dc526eb9fa493
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
4
|
+

|
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
|
-
|
62
|
-
|
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
|
data/lib/bankscrap/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|