avm-tools 0.40.0 → 0.41.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 +42 -5
- data/lib/avm/tools/version.rb +1 -1
- metadata +2 -3
- data/lib/avm/tools/runner/git/issue/complete.rb +0 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e421bc1935d15d29a51fc7ff4331d038ca161f502e00db2a87c0e390ddb02f2
|
4
|
+
data.tar.gz: a3dae44bc30d89174b6dd025116b44d78651bf8af9ca0fde05ee22078fee5f2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974d24b1a41919d84d50db87ea5b726c6b238eaf95cab4cc658201b3f6f4c704ad586804d1fcb2b61199f33f7ba45ef7998472ed188b0a37674db26827750acd
|
7
|
+
data.tar.gz: f211f0671c85e381f1a2b1edfcb53a816b420512f12f92cd9be376a2d05b63f92226e6ead605a3f177caf581d798681472592331ea05ef2ca81d4a23495a74ad
|
@@ -1,24 +1,61 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/console/docopt_runner'
|
4
|
-
require 'eac_ruby_utils/
|
5
|
-
|
4
|
+
require 'eac_ruby_utils/console/speaker'
|
5
|
+
require 'avm/git/issue/complete'
|
6
6
|
|
7
7
|
module Avm
|
8
8
|
module Tools
|
9
9
|
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
10
10
|
class Git < ::EacRubyUtils::Console::DocoptRunner
|
11
11
|
class Issue < ::EacRubyUtils::Console::DocoptRunner
|
12
|
+
include ::EacRubyUtils::Console::Speaker
|
13
|
+
|
12
14
|
DOC = <<~DOCOPT
|
13
|
-
|
15
|
+
Closes a issue in a Git repository.
|
14
16
|
|
15
17
|
Usage:
|
16
|
-
__PROGRAM__ [options]
|
18
|
+
__PROGRAM__ [options] [complete]
|
17
19
|
__PROGRAM__ -h | --help
|
18
20
|
|
19
21
|
Options:
|
20
|
-
-h --help
|
22
|
+
-h --help Show this screen.
|
23
|
+
-s --skip-validations=<validations> Does not validate conditions on <validations>
|
24
|
+
(Comma separated value).
|
25
|
+
-y --yes Does not ask for user confirmation.
|
26
|
+
|
27
|
+
Validations:
|
28
|
+
%%VALIDATIONS%%
|
21
29
|
DOCOPT
|
30
|
+
|
31
|
+
def run
|
32
|
+
complete = ::Avm::Git::Issue::Complete.new(git_complete_issue_options)
|
33
|
+
complete.start_banner
|
34
|
+
fatal_error('Some validation did not pass') unless complete.valid?
|
35
|
+
complete.run if options.fetch('complete') && confirm?
|
36
|
+
end
|
37
|
+
|
38
|
+
def doc
|
39
|
+
DOC.gsub('%%VALIDATIONS%%', doc_validations_list)
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def confirm?
|
45
|
+
options.fetch('--yes') || request_input('Confirm issue completion?', bool: true)
|
46
|
+
end
|
47
|
+
|
48
|
+
def skip_validations
|
49
|
+
options.fetch('--skip-validations').to_s.split(',').map(&:strip).reject(&:blank?)
|
50
|
+
end
|
51
|
+
|
52
|
+
def git_complete_issue_options
|
53
|
+
{ dir: context(:repository_path), skip_validations: skip_validations }
|
54
|
+
end
|
55
|
+
|
56
|
+
def doc_validations_list
|
57
|
+
::Avm::Git::Issue::Complete::VALIDATIONS.keys.map { |k| " * #{k}" }.join("\n")
|
58
|
+
end
|
22
59
|
end
|
23
60
|
end
|
24
61
|
end
|
data/lib/avm/tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.41.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -348,7 +348,6 @@ files:
|
|
348
348
|
- lib/avm/tools/runner/git/deploy.rb
|
349
349
|
- lib/avm/tools/runner/git/dirty_files.rb
|
350
350
|
- lib/avm/tools/runner/git/issue.rb
|
351
|
-
- lib/avm/tools/runner/git/issue/complete.rb
|
352
351
|
- lib/avm/tools/runner/git/revisions_test.rb
|
353
352
|
- lib/avm/tools/runner/ruby.rb
|
354
353
|
- lib/avm/tools/runner/ruby/rubocop.rb
|
@@ -1,65 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/console/docopt_runner'
|
4
|
-
require 'eac_ruby_utils/console/speaker'
|
5
|
-
require 'avm/git/issue/complete'
|
6
|
-
|
7
|
-
module Avm
|
8
|
-
module Tools
|
9
|
-
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
10
|
-
class Git < ::EacRubyUtils::Console::DocoptRunner
|
11
|
-
class Issue < ::EacRubyUtils::Console::DocoptRunner
|
12
|
-
class Complete < ::EacRubyUtils::Console::DocoptRunner
|
13
|
-
include ::EacRubyUtils::Console::Speaker
|
14
|
-
|
15
|
-
DOC = <<~DOCOPT
|
16
|
-
Closes a issue in a Git repository.
|
17
|
-
|
18
|
-
Usage:
|
19
|
-
__PROGRAM__ [options]
|
20
|
-
__PROGRAM__ -h | --help
|
21
|
-
|
22
|
-
Options:
|
23
|
-
-h --help Show this screen.
|
24
|
-
-s --skip-validations=<validations> Does not validate conditions on <validations>
|
25
|
-
(Comma separated value).
|
26
|
-
-y --yes Does not ask for user confirmation.
|
27
|
-
|
28
|
-
Validations:
|
29
|
-
%%VALIDATIONS%%
|
30
|
-
DOCOPT
|
31
|
-
|
32
|
-
def run
|
33
|
-
complete = ::Avm::Git::Issue::Complete.new(git_complete_issue_options)
|
34
|
-
complete.start_banner
|
35
|
-
fatal_error('Some validation did not pass') unless complete.valid?
|
36
|
-
complete.run if confirm?
|
37
|
-
end
|
38
|
-
|
39
|
-
def doc
|
40
|
-
DOC.gsub('%%VALIDATIONS%%', doc_validations_list)
|
41
|
-
end
|
42
|
-
|
43
|
-
private
|
44
|
-
|
45
|
-
def confirm?
|
46
|
-
options.fetch('--yes') || request_input('Confirm issue completion?', bool: true)
|
47
|
-
end
|
48
|
-
|
49
|
-
def skip_validations
|
50
|
-
options.fetch('--skip-validations').to_s.split(',').map(&:strip).reject(&:blank?)
|
51
|
-
end
|
52
|
-
|
53
|
-
def git_complete_issue_options
|
54
|
-
{ dir: context(:repository_path), skip_validations: skip_validations }
|
55
|
-
end
|
56
|
-
|
57
|
-
def doc_validations_list
|
58
|
-
::Avm::Git::Issue::Complete::VALIDATIONS.keys.map { |k| " * #{k}" }.join("\n")
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|