avm-tools 0.60.0 → 0.61.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a03f7f27fdfdd821203ba28f951ca16404a91b886453f9839e855dcf78627ef
4
- data.tar.gz: 8f02cc5b2e5454e4e5253be317e73c94d8f007538b3464281f9a84c1bd83768f
3
+ metadata.gz: '039f5b3b40307ddabe21c292a6f2fb1accf902dee691dac160648f9b305d094a'
4
+ data.tar.gz: f3a4993ab7abf9d0d5ae0a75196532460a4b5c5cd1ad24be2656f19113fd2749
5
5
  SHA512:
6
- metadata.gz: dd7d158d5b73aea3e54c715b2a13ec15fa3bc5fd6f87b3252f70ae9b0fd8dce36fb3a6b9c1d043f0b2365087848627595aaf7041142bf27f18d60a3f1ac4e0a9
7
- data.tar.gz: a8300831601639f79484dcd81934900c4be5003e85ed4e5a6345bb0c19ea5f4b3149556633238bd63fff97c933df7535622bfe588021c06e0567a064ccaca7e2
6
+ metadata.gz: 4777eeb21d3a8a7feb1bd172f23a5fef179456beb2503f20e855f82bd54c9ac06cff90c7d3319b435d6533123d66f28f72a39fb168f37b9897bf0468dbdecced
7
+ data.tar.gz: 9c90eac1666e3ff96c0bb58d71928f8fb9283e081f643e80989b19f6e05fe1cde3c86bda6d125a1b4f60c3e1f9b02b83eee17af7a0d91623f0dcacfdc5c023b9
@@ -9,6 +9,7 @@ module Avm
9
9
  class Runner < ::EacRubyUtils::Console::DocoptRunner
10
10
  class Git < ::EacRubyUtils::Console::DocoptRunner
11
11
  class Issue < ::EacRubyUtils::Console::DocoptRunner
12
+ enable_simple_cache
12
13
  include ::EacRubyUtils::Console::Speaker
13
14
 
14
15
  DOC = <<~DOCOPT
@@ -20,6 +21,8 @@ module Avm
20
21
 
21
22
  Options:
22
23
  -h --help Show this screen.
24
+ -f --uncomplete-unfail Do not exit with error if issue is not completed
25
+ or is invalid.
23
26
  -s --skip-validations=<validations> Does not validate conditions on <validations>
24
27
  (Comma separated value).
25
28
  -y --yes Does not ask for user confirmation.
@@ -28,11 +31,30 @@ module Avm
28
31
  %%VALIDATIONS%%
29
32
  DOCOPT
30
33
 
31
- def run
32
- complete = ::Avm::Git::Issue::Complete.new(git_complete_issue_options)
34
+ UNCOMPLETE_MESSAGE =
35
+
36
+ def run
37
+ banner
38
+ return unless validate
39
+
40
+ run_complete if options.fetch('complete')
41
+ success('Done!')
42
+ end
43
+
44
+ def banner
33
45
  complete.start_banner
34
- fatal_error('Some validation did not pass') unless complete.valid?
35
- complete.run if options.fetch('complete') && confirm?
46
+ end
47
+
48
+ def validate
49
+ return true if complete.valid?
50
+
51
+ uncomplete_message('Some validation did not pass')
52
+ end
53
+
54
+ def run_complete
55
+ return complete.run if confirm?
56
+
57
+ uncomplete_message('Issue was not completed')
36
58
  end
37
59
 
38
60
  def doc
@@ -41,6 +63,10 @@ module Avm
41
63
 
42
64
  private
43
65
 
66
+ def complete_uncached
67
+ ::Avm::Git::Issue::Complete.new(git_complete_issue_options)
68
+ end
69
+
44
70
  def confirm?
45
71
  options.fetch('--yes') || request_input('Confirm issue completion?', bool: true)
46
72
  end
@@ -56,6 +82,19 @@ module Avm
56
82
  def doc_validations_list
57
83
  ::Avm::Git::Issue::Complete::VALIDATIONS.keys.map { |k| " * #{k}" }.join("\n")
58
84
  end
85
+
86
+ def uncomplete_unfail?
87
+ options.fetch('--uncomplete-unfail')
88
+ end
89
+
90
+ def uncomplete_message(message)
91
+ if uncomplete_unfail?
92
+ warn(message)
93
+ else
94
+ fatal_error(message)
95
+ end
96
+ false
97
+ end
59
98
  end
60
99
  end
61
100
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.60.0'
5
+ VERSION = '0.61.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.60.0
4
+ version: 0.61.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company