monzo-cli 0.2.1 → 0.2.2
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/bin/monzo-cli +3 -4
- data/lib/api/mondo/client.rb +7 -3
- data/lib/monzo/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: c172de124dc0410bcb7c1aa816cd1e0fd49b8ea9
|
|
4
|
+
data.tar.gz: 4816fe9f21b4c2be0833f8cb794c02238a057ca8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1d38995461b606a5c5fa392282245528483693f4623d8022f9c8eb8926f83af5fd52a1bbc63c4447767102f4d165c6989912f8c7837554b58b9224c8984766a
|
|
7
|
+
data.tar.gz: 9c31e0c8bec89d99bff4bb6edd0ae778b339b3f60a831c382136138149340e08c95786e9fdfc141a83c513daa611fa71526620b97a71c1b82afc802ddc393fa6
|
data/bin/monzo-cli
CHANGED
|
@@ -34,7 +34,6 @@ command :accounts do |c|
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
puts table
|
|
37
|
-
|
|
38
37
|
end
|
|
39
38
|
end
|
|
40
39
|
|
|
@@ -42,7 +41,7 @@ desc 'States your account balance'
|
|
|
42
41
|
command :balance do |c|
|
|
43
42
|
c.action do |global_options, options, args|
|
|
44
43
|
|
|
45
|
-
result =
|
|
44
|
+
result = @monzo_api.balance
|
|
46
45
|
|
|
47
46
|
balance = result.balance
|
|
48
47
|
spent_today = result.spent_today
|
|
@@ -63,7 +62,7 @@ arg_name 'Maybe pagination'
|
|
|
63
62
|
command :transactions do |c|
|
|
64
63
|
c.action do |global_options, options, args|
|
|
65
64
|
|
|
66
|
-
transactions =
|
|
65
|
+
transactions = @monzo_api.transactions
|
|
67
66
|
|
|
68
67
|
table = Terminal::Table.new do |t|
|
|
69
68
|
t << %w(Amount date Description Balance)
|
|
@@ -75,7 +74,6 @@ command :transactions do |c|
|
|
|
75
74
|
end
|
|
76
75
|
|
|
77
76
|
puts table
|
|
78
|
-
|
|
79
77
|
end
|
|
80
78
|
end
|
|
81
79
|
|
|
@@ -90,6 +88,7 @@ pre do |global, command, options, args|
|
|
|
90
88
|
# on that command only
|
|
91
89
|
|
|
92
90
|
if @config.valid?
|
|
91
|
+
@monzo_api = MonzoApi.new(@config)
|
|
93
92
|
true
|
|
94
93
|
else
|
|
95
94
|
show_no_config_found_error
|
data/lib/api/mondo/client.rb
CHANGED
|
@@ -216,9 +216,13 @@ module Mondo
|
|
|
216
216
|
when 200..299, 300..399
|
|
217
217
|
# on non-redirecting 3xx statuses, just return the response
|
|
218
218
|
response
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
when 400..599
|
|
220
|
+
|
|
221
|
+
if response.status == 401
|
|
222
|
+
raise 'Your token has expired, follow these instructions: https://github.com/cesarferreira/monzo-cli#setup'
|
|
223
|
+
end
|
|
224
|
+
error = ApiError.new(response)
|
|
225
|
+
raise(error, "Status code #{response.status}")
|
|
222
226
|
else
|
|
223
227
|
error = ApiError.new(response)
|
|
224
228
|
raise(error, "Unhandled status code value of #{response.status}")
|
data/lib/monzo/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: monzo-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- cesar ferreira
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-11-
|
|
11
|
+
date: 2016-11-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|