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 +4 -4
- data/lib/avm/tools/runner/git/issue.rb +43 -4
- data/lib/avm/tools/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: '039f5b3b40307ddabe21c292a6f2fb1accf902dee691dac160648f9b305d094a'
|
4
|
+
data.tar.gz: f3a4993ab7abf9d0d5ae0a75196532460a4b5c5cd1ad24be2656f19113fd2749
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
32
|
-
|
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
|
-
|
35
|
-
|
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
|
data/lib/avm/tools/version.rb
CHANGED