burglar 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/burglar +1 -0
- data/lib/burglar/modules/plaid.rb +11 -6
- data/lib/burglar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 888fdf0ab4e0f0037eabacae540eedce6a207c536293349d49e1bc62b8d105f9
|
4
|
+
data.tar.gz: edb2f35b6c5ed890affdc40569b8452453d542fcaf186a33b3f51c2e0bfcdef6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 066c3e9b82f892de1fdbbf6e505a6a73a282fd4217cbafefe70a617e93221ec765d50a015ee54887ff51ecbd0ec0d4e035af2ad0e7b5d8cf84e63aa9435eaeb9
|
7
|
+
data.tar.gz: a48ee6e96da7dce706951edc2bfe8e8569a2f4db21eef42c65512ac041b8a66e6080cd1c6b5caa89487416949a9b1734fcd721b5eaf7688f3ca914c5e0af80c6
|
data/bin/burglar
CHANGED
@@ -10,6 +10,7 @@ def add_common_opts(c)
|
|
10
10
|
c.option :config, '-c FILE', '--config FILE', 'Config file to load'
|
11
11
|
c.option :begin, '-b DATE', '--begin DATE', 'Beginning of date range'
|
12
12
|
c.option :end, '-e DATE', '--end DATE', 'End of date range'
|
13
|
+
c.option :pending, '-p', '--pending', 'Include pending transactions'
|
13
14
|
end
|
14
15
|
|
15
16
|
def load_config(file)
|
@@ -12,7 +12,7 @@ module LogCabin
|
|
12
12
|
|
13
13
|
def raw_transactions # rubocop:disable Metrics/MethodLength
|
14
14
|
@raw_transactions ||= all_transactions.map do |row|
|
15
|
-
amount =
|
15
|
+
amount = format('$%.2f', row.amount)
|
16
16
|
name = row.name.downcase
|
17
17
|
action = guess_action(name)
|
18
18
|
state = row.pending ? :pending : :cleared
|
@@ -24,7 +24,8 @@ module LogCabin
|
|
24
24
|
actions: [
|
25
25
|
{ name: action, amount: amount },
|
26
26
|
{ name: account_name }
|
27
|
-
]
|
27
|
+
],
|
28
|
+
tags: { 'transaction_id' => row.transaction_id }
|
28
29
|
)
|
29
30
|
end
|
30
31
|
end
|
@@ -58,6 +59,7 @@ module LogCabin
|
|
58
59
|
new, total = get_transactions_page(list.length)
|
59
60
|
list += new
|
60
61
|
end
|
62
|
+
list.reject!(&:pending) unless @options[:pending]
|
61
63
|
@all_transactions = list
|
62
64
|
end
|
63
65
|
|
@@ -77,15 +79,18 @@ module LogCabin
|
|
77
79
|
@accounts ||= api_client.accounts.get(access_token)['accounts']
|
78
80
|
end
|
79
81
|
|
82
|
+
def account
|
83
|
+
@account ||= accounts.first if accounts.size == 1
|
84
|
+
@account ||= accounts.find { |x| x['name'] == account_clean_name }
|
85
|
+
end
|
86
|
+
|
80
87
|
def account_id
|
81
|
-
@account_id ||=
|
82
|
-
x['name'] == account_clean_name
|
83
|
-
end['account_id']
|
88
|
+
@account_id ||= account['account_id']
|
84
89
|
end
|
85
90
|
|
86
91
|
def account_clean_name
|
87
92
|
@account_clean_name ||= @options[:name] || raise(
|
88
|
-
'
|
93
|
+
'Account name needed (more than one option) but not provided'
|
89
94
|
)
|
90
95
|
end
|
91
96
|
|
data/lib/burglar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: burglar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cymbal
|