eac_cli 0.27.0 → 0.27.3
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/lib/eac_cli/old_configs/entry_reader.rb +1 -1
- data/lib/eac_cli/old_configs/read_entry_options.rb +1 -1
- data/lib/eac_cli/parser.rb +2 -2
- data/lib/eac_cli/runner/context.rb +4 -0
- data/lib/eac_cli/runner/instance_methods.rb +3 -4
- data/lib/eac_cli/runner_with/help/builder.rb +1 -1
- data/lib/eac_cli/runner_with/subcommands.rb +5 -5
- data/lib/eac_cli/runner_with_set.rb +2 -2
- data/lib/eac_cli/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13923176efdc8317f5f39295cb3e11e4735d66e7997580af8a5f3c8f2f0c03f4
|
4
|
+
data.tar.gz: 2f9edad2f2ea7484c88e9948f6c5ff47635b13ddfc2809fa2af481ebd0c347c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0918b4794d0ced61971d2f308bb92a731b2c70130774a4e3b68db807fcb94e4a3addaa78488b1a1ab4a38e76557f1bf7fd0a1b5198dc545eefbeecfc5db5b593'
|
7
|
+
data.tar.gz: 6feb7e12b85ded5683858a2943390f95f092b79b4023f193c3792f24d3ed6e6294ea111f82c667c65dce50ccb005abea0c5db8233dadc6736442ab21c548c75f
|
data/lib/eac_cli/parser.rb
CHANGED
@@ -19,12 +19,12 @@ module EacCli
|
|
19
19
|
|
20
20
|
def alternatives_parsed(error)
|
21
21
|
alternatives.select { |a| error == a.error? }.map(&:parsed).reverse
|
22
|
-
|
22
|
+
.inject(::EacRubyUtils::Struct.new) { |a, e| a.merge(e) }
|
23
23
|
end
|
24
24
|
|
25
25
|
def alternatives_uncached
|
26
26
|
definition.alternatives
|
27
|
-
|
27
|
+
.map { |alternative| ::EacCli::Parser::Alternative.new(alternative, argv) }
|
28
28
|
end
|
29
29
|
|
30
30
|
def first_error_uncached
|
@@ -23,6 +23,10 @@ module EacCli
|
|
23
23
|
raise ::NameError, "No method \"#{method_name}\" found in #{runner} or in its ancestors"
|
24
24
|
end
|
25
25
|
|
26
|
+
def respond_to_call?((method_name))
|
27
|
+
parent.respond_to?(:runner_context) && parent.runner_context.respond_to_call?(method_name)
|
28
|
+
end
|
29
|
+
|
26
30
|
protected
|
27
31
|
|
28
32
|
def parent_call(method_name, *args)
|
@@ -39,14 +39,13 @@ module EacCli
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def respond_to_missing?(method, include_all = false)
|
42
|
-
runner_context.
|
43
|
-
super
|
42
|
+
runner_context.respond_to_call?(method) || super
|
44
43
|
end
|
45
44
|
|
46
45
|
def method_missing(method, *args, &block)
|
47
|
-
return super
|
46
|
+
return super unless runner_context.respond_to_call?(method)
|
48
47
|
|
49
|
-
runner_context.
|
48
|
+
runner_context.call(method, *args, &block)
|
50
49
|
end
|
51
50
|
end
|
52
51
|
end
|
@@ -54,7 +54,7 @@ module EacCli
|
|
54
54
|
def options_section
|
55
55
|
"Options:\n" +
|
56
56
|
definition.alternatives.flat_map(&:options)
|
57
|
-
|
57
|
+
.map { |option| IDENT + option_definition(option) + "\n" }.join
|
58
58
|
end
|
59
59
|
|
60
60
|
def usage_section
|
@@ -17,7 +17,7 @@ module EacCli
|
|
17
17
|
common_concern do
|
18
18
|
include ::EacCli::Runner
|
19
19
|
runner_definition.singleton_class
|
20
|
-
|
20
|
+
.include(::EacCli::RunnerWith::Subcommands::DefinitionConcern)
|
21
21
|
end
|
22
22
|
|
23
23
|
EXTRA_AVAILABLE_SUBCOMMANDS_METHOD_NAME = :extra_available_subcommands
|
@@ -28,9 +28,9 @@ module EacCli
|
|
28
28
|
|
29
29
|
def available_subcommands_auto
|
30
30
|
self.class.constants
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
.map { |name| [name.to_s.underscore.gsub('_', '-'), self.class.const_get(name)] }
|
32
|
+
.select { |c| ::EacCli::RunnerWith::Subcommands.runner?(c[1]) }
|
33
|
+
.to_h.with_indifferent_access
|
34
34
|
end
|
35
35
|
|
36
36
|
def available_subcommands_extra
|
@@ -95,7 +95,7 @@ module EacCli
|
|
95
95
|
raise(::EacCli::Parser::Error.new(
|
96
96
|
self.class.runner_definition, runner_context.argv,
|
97
97
|
"Subcommand \"#{subcommand_name}\" not found " \
|
98
|
-
"(Available: #{available_subcommands.keys}"
|
98
|
+
"(Available: #{available_subcommands.keys})"
|
99
99
|
))
|
100
100
|
end
|
101
101
|
|
@@ -32,8 +32,8 @@ module EacCli
|
|
32
32
|
|
33
33
|
def key_to_module(key)
|
34
34
|
namespace_set.lazy
|
35
|
-
|
36
|
-
|
35
|
+
.map { |namespace| key_to_module_in_namespace(namespace, key) }
|
36
|
+
.find(&:present?) ||
|
37
37
|
raise("Not module found with key \"#{key}\" (Namespaces: #{namespace_set})")
|
38
38
|
end
|
39
39
|
|
data/lib/eac_cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.5.1
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 0.5.1
|
69
69
|
description:
|
70
70
|
email:
|
71
71
|
executables: []
|