burglar 0.1.3 → 0.1.4
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/burglar +17 -1
- data/lib/burglar/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b4e6abd699b737c56b5c19d04138c09a60401735b6b9e40076dbc9026f45272
|
4
|
+
data.tar.gz: c852dd84d722e36f0e3832853202bafdc6b3f55da201133cb9c93bf515ef27eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 552a2589f955eccb6d9e41f73877e934853caaeeae3b56b4f0adad46084f1a7c5833224dc74001245d4431ace17afa9612c9c079e5feb3b3c9e0d1aa3ba2b164
|
7
|
+
data.tar.gz: 9719685ab201c0de159ff6c65ac5e1282a3c6d4d19950d76cab43e99235d547ac1ee2a7a414b1644e4035b69f75a4e151d0a204d0e8b47b2aaf857c0ee00de5d
|
data/bin/burglar
CHANGED
@@ -9,6 +9,7 @@ def add_common_opts(c)
|
|
9
9
|
c.option :begin, '-b DATE', '--begin DATE', 'Beginning of date range'
|
10
10
|
c.option :end, '-e DATE', '--end DATE', 'End of date range'
|
11
11
|
c.option :pending, '-p', '--pending', 'Include pending transactions'
|
12
|
+
c.option :shell, '-s', '--shell', 'Launch a REPL with the burglar object'
|
12
13
|
end
|
13
14
|
|
14
15
|
def date_parse_or_default(string, default)
|
@@ -16,6 +17,16 @@ def date_parse_or_default(string, default)
|
|
16
17
|
Date.parse(string)
|
17
18
|
end
|
18
19
|
|
20
|
+
def launch_shell(res)
|
21
|
+
res.transactions
|
22
|
+
require 'pry'
|
23
|
+
binding.pry # rubocop:disable Lint/Debugger
|
24
|
+
rescue LoadError
|
25
|
+
warn 'Falling back to IRB because Pry failed to load'
|
26
|
+
require 'irb'
|
27
|
+
binding.irb
|
28
|
+
end
|
29
|
+
|
19
30
|
Mercenary.program(:burglar) do |p|
|
20
31
|
p.version Burglar::VERSION
|
21
32
|
p.description 'Load data from banks'
|
@@ -26,6 +37,11 @@ Mercenary.program(:burglar) do |p|
|
|
26
37
|
p.action do |_, options|
|
27
38
|
options[:end] = date_parse_or_default(options[:end], Date.today)
|
28
39
|
options[:begin] = date_parse_or_default(options[:begin], options[:end] - 30)
|
29
|
-
|
40
|
+
res = Burglar.new(options)
|
41
|
+
if options[:shell]
|
42
|
+
launch_shell res
|
43
|
+
else
|
44
|
+
puts res.transactions
|
45
|
+
end
|
30
46
|
end
|
31
47
|
end
|
data/lib/burglar/version.rb
CHANGED