burglar 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/burglar +17 -1
  3. data/lib/burglar/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7ae039506dedd45df72bad8cb11ace829c20845bc464cf5fbc2fc7a5a8078b7
4
- data.tar.gz: 767f78709f5d46b6ea462f6bbaf4396a87f27f6cdf14c86385390df944b4cc21
3
+ metadata.gz: 5b4e6abd699b737c56b5c19d04138c09a60401735b6b9e40076dbc9026f45272
4
+ data.tar.gz: c852dd84d722e36f0e3832853202bafdc6b3f55da201133cb9c93bf515ef27eb
5
5
  SHA512:
6
- metadata.gz: 9ddb0db7ce02ff35666b8ed827b31436d04ac7a63e0f988f924cb5ab274269367717b09039b5aad5a7f65b1f1d4b3fc303292b6351e9bf5cbba04b5c75b0cba7
7
- data.tar.gz: 9ebdb1f40ff322ff97007c1eba14310ed98b13262e3030beefd2bdd3546f1d6815105ac4474087d48e9625332dd67ddb50e0ad4e23eaa985d5bbd6e4d5d8c982
6
+ metadata.gz: 552a2589f955eccb6d9e41f73877e934853caaeeae3b56b4f0adad46084f1a7c5833224dc74001245d4431ace17afa9612c9c079e5feb3b3c9e0d1aa3ba2b164
7
+ data.tar.gz: 9719685ab201c0de159ff6c65ac5e1282a3c6d4d19950d76cab43e99235d547ac1ee2a7a414b1644e4035b69f75a4e151d0a204d0e8b47b2aaf857c0ee00de5d
@@ -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
- puts Burglar.new(options).transactions
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
@@ -3,5 +3,5 @@
3
3
  ##
4
4
  # Set the version (needed for Mercenary -v)
5
5
  module Burglar
6
- VERSION = '0.1.3'.freeze
6
+ VERSION = '0.1.4'.freeze
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: burglar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker