eac_tools 0.82.0 → 0.83.0
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/Gemfile.lock +45 -40
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +4 -3
- data/sub/avm/lib/avm/data/rotate.rb +1 -1
- data/sub/avm/lib/avm/launcher/instances/base/publishing.rb +1 -1
- data/sub/avm/lib/avm/registry/from_gems.rb +2 -2
- data/sub/avm/lib/avm/rspec/shared_examples/avm_file_formats_with_fixtures.rb +0 -1
- data/sub/avm/lib/avm/source_generators/base.rb +1 -0
- data/sub/avm/lib/avm/source_generators/runner.rb +6 -0
- data/sub/avm/lib/avm/sources/tests/builder.rb +1 -1
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm/spec/lib/avm/launcher/instances/base_spec_files/projects/avm-tools_stub/avm-tools.gemspec +1 -0
- data/sub/avm/spec/lib/avm/launcher/instances/base_spec_files/projects/ruby_gem_stub/ruby_gem_stub.gemspec +1 -0
- data/sub/avm-eac_asciidoctor_base0/Gemfile +2 -2
- data/sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +6 -5
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb +5 -3
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document.rb +2 -2
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/document.rb +2 -2
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb +1 -3
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/file_formats/base_spec.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build/document_spec.rb +18 -18
- data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build/document_spec_files/pre_processed_root_body.adoc +1 -0
- data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec.rb +3 -3
- data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/source_generators/base_spec.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/sources/base_spec.rb +2 -2
- data/sub/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/spec/spec_helper/eac_asciidoctor_base0_stubs.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/spec/spec_helper.rb +3 -3
- data/sub/avm-eac_python_base0/Gemfile +2 -2
- data/sub/avm-eac_python_base0/avm-eac_python_base0.gemspec +5 -4
- data/sub/avm-eac_python_base0/lib/avm/eac_python_base0/executables.rb +1 -1
- data/sub/avm-eac_python_base0/lib/avm/eac_python_base0/version.rb +1 -1
- data/sub/avm-eac_python_base0/spec/lib/avm/eac_python_base0/file_formats/base_spec.rb +1 -1
- data/sub/avm-eac_python_base0/spec/lib/avm/eac_python_base0/file_formats/base_spec_files/python_code.source +1 -1
- data/sub/avm-eac_python_base0/spec/lib/avm/eac_python_base0/file_formats/base_spec_files/python_code.target +1 -1
- data/sub/avm-eac_python_base0/spec/rubocop_spec.rb +1 -1
- data/sub/avm-eac_python_base0/spec/spec_helper.rb +1 -1
- data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +2 -2
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/rubocop_command.rb +2 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- metadata +14 -144
- data/sub/eac_cli/Gemfile +0 -8
- data/sub/eac_cli/eac_cli.gemspec +0 -22
- data/sub/eac_cli/lib/eac_cli/config/entry/options.rb +0 -58
- data/sub/eac_cli/lib/eac_cli/config/entry/undefined.rb +0 -31
- data/sub/eac_cli/lib/eac_cli/config/entry.rb +0 -60
- data/sub/eac_cli/lib/eac_cli/config.rb +0 -17
- data/sub/eac_cli/lib/eac_cli/core_ext.rb +0 -6
- data/sub/eac_cli/lib/eac_cli/default_runner.rb +0 -14
- data/sub/eac_cli/lib/eac_cli/definition/alternative.rb +0 -105
- data/sub/eac_cli/lib/eac_cli/definition/argument_option.rb +0 -21
- data/sub/eac_cli/lib/eac_cli/definition/boolean_option.rb +0 -27
- data/sub/eac_cli/lib/eac_cli/definition/error.rb +0 -8
- data/sub/eac_cli/lib/eac_cli/definition/option/initialize_args_parser.rb +0 -48
- data/sub/eac_cli/lib/eac_cli/definition/option.rb +0 -73
- data/sub/eac_cli/lib/eac_cli/definition/option_or_positional.rb +0 -43
- data/sub/eac_cli/lib/eac_cli/definition/positional.rb +0 -53
- data/sub/eac_cli/lib/eac_cli/definition.rb +0 -109
- data/sub/eac_cli/lib/eac_cli/enum.rb +0 -45
- data/sub/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +0 -80
- data/sub/eac_cli/lib/eac_cli/old_configs/password_entry_reader.rb +0 -16
- data/sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +0 -44
- data/sub/eac_cli/lib/eac_cli/old_configs/store_passwords_entry_reader.rb +0 -25
- data/sub/eac_cli/lib/eac_cli/old_configs.rb +0 -35
- data/sub/eac_cli/lib/eac_cli/parser/alternative/any_options.rb +0 -19
- data/sub/eac_cli/lib/eac_cli/parser/alternative/argv.rb +0 -19
- data/sub/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb +0 -24
- data/sub/eac_cli/lib/eac_cli/parser/alternative/long_options.rb +0 -37
- data/sub/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb +0 -29
- data/sub/eac_cli/lib/eac_cli/parser/alternative/options.rb +0 -29
- data/sub/eac_cli/lib/eac_cli/parser/alternative/positionals.rb +0 -30
- data/sub/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +0 -54
- data/sub/eac_cli/lib/eac_cli/parser/alternative.rb +0 -103
- data/sub/eac_cli/lib/eac_cli/parser/collector.rb +0 -55
- data/sub/eac_cli/lib/eac_cli/parser/error.rb +0 -15
- data/sub/eac_cli/lib/eac_cli/parser.rb +0 -34
- data/sub/eac_cli/lib/eac_cli/patches/object/runner_with.rb +0 -26
- data/sub/eac_cli/lib/eac_cli/patches/object.rb +0 -5
- data/sub/eac_cli/lib/eac_cli/patches.rb +0 -4
- data/sub/eac_cli/lib/eac_cli/rspec/setup.rb +0 -42
- data/sub/eac_cli/lib/eac_cli/rspec.rb +0 -9
- data/sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb +0 -38
- data/sub/eac_cli/lib/eac_cli/runner/class_runner.rb +0 -36
- data/sub/eac_cli/lib/eac_cli/runner/context.rb +0 -63
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/base.rb +0 -24
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/parent.rb +0 -27
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/runner.rb +0 -20
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/runner_missing_method.rb +0 -32
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/set.rb +0 -44
- data/sub/eac_cli/lib/eac_cli/runner/context_responders.rb +0 -11
- data/sub/eac_cli/lib/eac_cli/runner/exit.rb +0 -14
- data/sub/eac_cli/lib/eac_cli/runner/for_context.rb +0 -40
- data/sub/eac_cli/lib/eac_cli/runner/instance_methods.rb +0 -45
- data/sub/eac_cli/lib/eac_cli/runner.rb +0 -50
- data/sub/eac_cli/lib/eac_cli/runner_with/confirmation.rb +0 -44
- data/sub/eac_cli/lib/eac_cli/runner_with/help/builder/alternative.rb +0 -63
- data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +0 -81
- data/sub/eac_cli/lib/eac_cli/runner_with/help/layout.rb +0 -40
- data/sub/eac_cli/lib/eac_cli/runner_with/help.rb +0 -53
- data/sub/eac_cli/lib/eac_cli/runner_with/input.rb +0 -36
- data/sub/eac_cli/lib/eac_cli/runner_with/output.rb +0 -58
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/base_formatter.rb +0 -15
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/csv_formatter.rb +0 -23
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/yaml_formatter.rb +0 -18
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item.rb +0 -42
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list/base_formatter.rb +0 -30
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb +0 -26
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list/yaml_formatter.rb +0 -23
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list.rb +0 -42
- data/sub/eac_cli/lib/eac_cli/runner_with/subcommands/definition_concern.rb +0 -10
- data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +0 -129
- data/sub/eac_cli/lib/eac_cli/runner_with.rb +0 -9
- data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +0 -56
- data/sub/eac_cli/lib/eac_cli/speaker/constants.rb +0 -13
- data/sub/eac_cli/lib/eac_cli/speaker/input_blocked.rb +0 -16
- data/sub/eac_cli/lib/eac_cli/speaker/input_requested.rb +0 -8
- data/sub/eac_cli/lib/eac_cli/speaker/list.rb +0 -61
- data/sub/eac_cli/lib/eac_cli/speaker/options.rb +0 -38
- data/sub/eac_cli/lib/eac_cli/speaker.rb +0 -127
- data/sub/eac_cli/lib/eac_cli/version.rb +0 -5
- data/sub/eac_cli/lib/eac_cli.rb +0 -7
- data/sub/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +0 -18
- data/sub/eac_cli/spec/lib/eac_cli/old_configs_spec.rb +0 -14
- data/sub/eac_cli/spec/lib/eac_cli/parser/alternative/subcommands_spec.rb +0 -58
- data/sub/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb +0 -89
- data/sub/eac_cli/spec/lib/eac_cli/runner/for_context_spec.rb +0 -79
- data/sub/eac_cli/spec/lib/eac_cli/runner_spec.rb +0 -129
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/confirmation_spec.rb +0 -42
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/help/layout_spec.rb +0 -21
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +0 -51
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/output_spec.rb +0 -81
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb +0 -98
- data/sub/eac_cli/spec/lib/eac_cli/speaker_spec.rb +0 -32
- data/sub/eac_cli/spec/rubocop_spec.rb +0 -3
- data/sub/eac_cli/spec/spec_helper.rb +0 -4
- data/sub/eac_config/Gemfile +0 -8
- data/sub/eac_config/eac_config.gemspec +0 -19
- data/sub/eac_config/lib/eac_config/entries.rb +0 -35
- data/sub/eac_config/lib/eac_config/entry/not_found_error.rb +0 -13
- data/sub/eac_config/lib/eac_config/entry.rb +0 -64
- data/sub/eac_config/lib/eac_config/entry_path.rb +0 -89
- data/sub/eac_config/lib/eac_config/envvars_node/entry.rb +0 -54
- data/sub/eac_config/lib/eac_config/envvars_node.rb +0 -35
- data/sub/eac_config/lib/eac_config/load_nodes_search.rb +0 -39
- data/sub/eac_config/lib/eac_config/load_path.rb +0 -28
- data/sub/eac_config/lib/eac_config/node.rb +0 -81
- data/sub/eac_config/lib/eac_config/node_entry.rb +0 -28
- data/sub/eac_config/lib/eac_config/node_uri/instanciate_single.rb +0 -29
- data/sub/eac_config/lib/eac_config/node_uri.rb +0 -45
- data/sub/eac_config/lib/eac_config/old_configs/base.rb +0 -43
- data/sub/eac_config/lib/eac_config/old_configs/file.rb +0 -47
- data/sub/eac_config/lib/eac_config/old_configs.rb +0 -75
- data/sub/eac_config/lib/eac_config/paths_hash/entry_key_error.rb +0 -8
- data/sub/eac_config/lib/eac_config/paths_hash/node.rb +0 -67
- data/sub/eac_config/lib/eac_config/paths_hash/path_search.rb +0 -39
- data/sub/eac_config/lib/eac_config/paths_hash.rb +0 -63
- data/sub/eac_config/lib/eac_config/prefixed_path_node/entry.rb +0 -25
- data/sub/eac_config/lib/eac_config/prefixed_path_node.rb +0 -19
- data/sub/eac_config/lib/eac_config/rspec/setup.rb +0 -65
- data/sub/eac_config/lib/eac_config/rspec.rb +0 -9
- data/sub/eac_config/lib/eac_config/version.rb +0 -5
- data/sub/eac_config/lib/eac_config/yaml_file_node/entry.rb +0 -36
- data/sub/eac_config/lib/eac_config/yaml_file_node/self_entries.rb +0 -72
- data/sub/eac_config/lib/eac_config/yaml_file_node.rb +0 -54
- data/sub/eac_config/lib/eac_config.rb +0 -7
- data/sub/eac_config/spec/lib/eac_config/entry_path_spec.rb +0 -30
- data/sub/eac_config/spec/lib/eac_config/envvars_node/entry_spec.rb +0 -14
- data/sub/eac_config/spec/lib/eac_config/envvars_node_spec.rb +0 -51
- data/sub/eac_config/spec/lib/eac_config/old_configs_spec.rb +0 -46
- data/sub/eac_config/spec/lib/eac_config/paths_hash_spec.rb +0 -88
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec.rb +0 -88
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1.yaml +0 -10
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_1.yaml +0 -4
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2/storage1_2_1.yaml +0 -4
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2.yaml +0 -10
- data/sub/eac_config/spec/rubocop_spec.rb +0 -3
- data/sub/eac_config/spec/spec_helper.rb +0 -4
|
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
|
13
13
|
s.files = Dir['{lib,locale,template}/**/*']
|
|
14
14
|
s.required_ruby_version = '>= 2.7'
|
|
15
15
|
|
|
16
|
-
s.add_dependency 'aranha-parsers', '~> 0.
|
|
17
|
-
s.add_dependency 'avm', '~> 0.
|
|
16
|
+
s.add_dependency 'aranha-parsers', '~> 0.22'
|
|
17
|
+
s.add_dependency 'avm', '~> 0.84'
|
|
18
18
|
s.add_dependency 'avm-eac_generic_base0', '~> 0.12', '>= 0.12.1'
|
|
19
19
|
s.add_dependency 'eac_envs-http', '~> 0.4', '>= 0.4.1'
|
|
20
20
|
s.add_dependency 'eac_ruby_utils', '~> 0.119', '>= 0.119.2'
|
|
@@ -56,7 +56,8 @@ module Avm
|
|
|
56
56
|
|
|
57
57
|
# @return [Array<String>]
|
|
58
58
|
def rubocop_command_args
|
|
59
|
-
r = [
|
|
59
|
+
r = []
|
|
60
|
+
r += ['--config', source.rubocop_config_path] if source.rubocop_config_path.file?
|
|
60
61
|
r << ignore_parent_exclusion_option if ignore_parent_exclusion?
|
|
61
62
|
if autocorrect_all?
|
|
62
63
|
r << autocorrect_all_option
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eac_tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.83.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Put here the authors
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-11-
|
|
11
|
+
date: 2023-11-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: avm
|
|
@@ -16,28 +16,28 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0.
|
|
19
|
+
version: '0.84'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0.
|
|
26
|
+
version: '0.84'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: avm-eac_asciidoctor_base0
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0.
|
|
33
|
+
version: '0.20'
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0.
|
|
40
|
+
version: '0.20'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: avm-eac_generic_base0
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -141,7 +141,7 @@ dependencies:
|
|
|
141
141
|
version: '0.2'
|
|
142
142
|
- - ">="
|
|
143
143
|
- !ruby/object:Gem::Version
|
|
144
|
-
version: 0.2.
|
|
144
|
+
version: 0.2.2
|
|
145
145
|
type: :runtime
|
|
146
146
|
prerelease: false
|
|
147
147
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -151,7 +151,7 @@ dependencies:
|
|
|
151
151
|
version: '0.2'
|
|
152
152
|
- - ">="
|
|
153
153
|
- !ruby/object:Gem::Version
|
|
154
|
-
version: 0.2.
|
|
154
|
+
version: 0.2.2
|
|
155
155
|
- !ruby/object:Gem::Dependency
|
|
156
156
|
name: avm-eac_rails_base0
|
|
157
157
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -215,6 +215,9 @@ dependencies:
|
|
|
215
215
|
- - "~>"
|
|
216
216
|
- !ruby/object:Gem::Version
|
|
217
217
|
version: '0.33'
|
|
218
|
+
- - ">="
|
|
219
|
+
- !ruby/object:Gem::Version
|
|
220
|
+
version: 0.33.1
|
|
218
221
|
type: :runtime
|
|
219
222
|
prerelease: false
|
|
220
223
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -222,6 +225,9 @@ dependencies:
|
|
|
222
225
|
- - "~>"
|
|
223
226
|
- !ruby/object:Gem::Version
|
|
224
227
|
version: '0.33'
|
|
228
|
+
- - ">="
|
|
229
|
+
- !ruby/object:Gem::Version
|
|
230
|
+
version: 0.33.1
|
|
225
231
|
- !ruby/object:Gem::Dependency
|
|
226
232
|
name: avm-eac_webapp_base0
|
|
227
233
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -1367,142 +1373,6 @@ files:
|
|
|
1367
1373
|
- sub/avm/spec/lib/avm/sources/runner_spec.rb
|
|
1368
1374
|
- sub/avm/spec/rubocop_spec.rb
|
|
1369
1375
|
- sub/avm/spec/spec_helper.rb
|
|
1370
|
-
- sub/eac_cli/Gemfile
|
|
1371
|
-
- sub/eac_cli/eac_cli.gemspec
|
|
1372
|
-
- sub/eac_cli/lib/eac_cli.rb
|
|
1373
|
-
- sub/eac_cli/lib/eac_cli/config.rb
|
|
1374
|
-
- sub/eac_cli/lib/eac_cli/config/entry.rb
|
|
1375
|
-
- sub/eac_cli/lib/eac_cli/config/entry/options.rb
|
|
1376
|
-
- sub/eac_cli/lib/eac_cli/config/entry/undefined.rb
|
|
1377
|
-
- sub/eac_cli/lib/eac_cli/core_ext.rb
|
|
1378
|
-
- sub/eac_cli/lib/eac_cli/default_runner.rb
|
|
1379
|
-
- sub/eac_cli/lib/eac_cli/definition.rb
|
|
1380
|
-
- sub/eac_cli/lib/eac_cli/definition/alternative.rb
|
|
1381
|
-
- sub/eac_cli/lib/eac_cli/definition/argument_option.rb
|
|
1382
|
-
- sub/eac_cli/lib/eac_cli/definition/boolean_option.rb
|
|
1383
|
-
- sub/eac_cli/lib/eac_cli/definition/error.rb
|
|
1384
|
-
- sub/eac_cli/lib/eac_cli/definition/option.rb
|
|
1385
|
-
- sub/eac_cli/lib/eac_cli/definition/option/initialize_args_parser.rb
|
|
1386
|
-
- sub/eac_cli/lib/eac_cli/definition/option_or_positional.rb
|
|
1387
|
-
- sub/eac_cli/lib/eac_cli/definition/positional.rb
|
|
1388
|
-
- sub/eac_cli/lib/eac_cli/enum.rb
|
|
1389
|
-
- sub/eac_cli/lib/eac_cli/old_configs.rb
|
|
1390
|
-
- sub/eac_cli/lib/eac_cli/old_configs/entry_reader.rb
|
|
1391
|
-
- sub/eac_cli/lib/eac_cli/old_configs/password_entry_reader.rb
|
|
1392
|
-
- sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb
|
|
1393
|
-
- sub/eac_cli/lib/eac_cli/old_configs/store_passwords_entry_reader.rb
|
|
1394
|
-
- sub/eac_cli/lib/eac_cli/parser.rb
|
|
1395
|
-
- sub/eac_cli/lib/eac_cli/parser/alternative.rb
|
|
1396
|
-
- sub/eac_cli/lib/eac_cli/parser/alternative/any_options.rb
|
|
1397
|
-
- sub/eac_cli/lib/eac_cli/parser/alternative/argv.rb
|
|
1398
|
-
- sub/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb
|
|
1399
|
-
- sub/eac_cli/lib/eac_cli/parser/alternative/long_options.rb
|
|
1400
|
-
- sub/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb
|
|
1401
|
-
- sub/eac_cli/lib/eac_cli/parser/alternative/options.rb
|
|
1402
|
-
- sub/eac_cli/lib/eac_cli/parser/alternative/positionals.rb
|
|
1403
|
-
- sub/eac_cli/lib/eac_cli/parser/alternative/short_options.rb
|
|
1404
|
-
- sub/eac_cli/lib/eac_cli/parser/collector.rb
|
|
1405
|
-
- sub/eac_cli/lib/eac_cli/parser/error.rb
|
|
1406
|
-
- sub/eac_cli/lib/eac_cli/patches.rb
|
|
1407
|
-
- sub/eac_cli/lib/eac_cli/patches/object.rb
|
|
1408
|
-
- sub/eac_cli/lib/eac_cli/patches/object/runner_with.rb
|
|
1409
|
-
- sub/eac_cli/lib/eac_cli/rspec.rb
|
|
1410
|
-
- sub/eac_cli/lib/eac_cli/rspec/setup.rb
|
|
1411
|
-
- sub/eac_cli/lib/eac_cli/runner.rb
|
|
1412
|
-
- sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
|
|
1413
|
-
- sub/eac_cli/lib/eac_cli/runner/class_runner.rb
|
|
1414
|
-
- sub/eac_cli/lib/eac_cli/runner/context.rb
|
|
1415
|
-
- sub/eac_cli/lib/eac_cli/runner/context_responders.rb
|
|
1416
|
-
- sub/eac_cli/lib/eac_cli/runner/context_responders/base.rb
|
|
1417
|
-
- sub/eac_cli/lib/eac_cli/runner/context_responders/parent.rb
|
|
1418
|
-
- sub/eac_cli/lib/eac_cli/runner/context_responders/runner.rb
|
|
1419
|
-
- sub/eac_cli/lib/eac_cli/runner/context_responders/runner_missing_method.rb
|
|
1420
|
-
- sub/eac_cli/lib/eac_cli/runner/context_responders/set.rb
|
|
1421
|
-
- sub/eac_cli/lib/eac_cli/runner/exit.rb
|
|
1422
|
-
- sub/eac_cli/lib/eac_cli/runner/for_context.rb
|
|
1423
|
-
- sub/eac_cli/lib/eac_cli/runner/instance_methods.rb
|
|
1424
|
-
- sub/eac_cli/lib/eac_cli/runner_with.rb
|
|
1425
|
-
- sub/eac_cli/lib/eac_cli/runner_with/confirmation.rb
|
|
1426
|
-
- sub/eac_cli/lib/eac_cli/runner_with/help.rb
|
|
1427
|
-
- sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb
|
|
1428
|
-
- sub/eac_cli/lib/eac_cli/runner_with/help/builder/alternative.rb
|
|
1429
|
-
- sub/eac_cli/lib/eac_cli/runner_with/help/layout.rb
|
|
1430
|
-
- sub/eac_cli/lib/eac_cli/runner_with/input.rb
|
|
1431
|
-
- sub/eac_cli/lib/eac_cli/runner_with/output.rb
|
|
1432
|
-
- sub/eac_cli/lib/eac_cli/runner_with/output_item.rb
|
|
1433
|
-
- sub/eac_cli/lib/eac_cli/runner_with/output_item/base_formatter.rb
|
|
1434
|
-
- sub/eac_cli/lib/eac_cli/runner_with/output_item/csv_formatter.rb
|
|
1435
|
-
- sub/eac_cli/lib/eac_cli/runner_with/output_item/yaml_formatter.rb
|
|
1436
|
-
- sub/eac_cli/lib/eac_cli/runner_with/output_list.rb
|
|
1437
|
-
- sub/eac_cli/lib/eac_cli/runner_with/output_list/base_formatter.rb
|
|
1438
|
-
- sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
|
|
1439
|
-
- sub/eac_cli/lib/eac_cli/runner_with/output_list/yaml_formatter.rb
|
|
1440
|
-
- sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb
|
|
1441
|
-
- sub/eac_cli/lib/eac_cli/runner_with/subcommands/definition_concern.rb
|
|
1442
|
-
- sub/eac_cli/lib/eac_cli/runner_with_set.rb
|
|
1443
|
-
- sub/eac_cli/lib/eac_cli/speaker.rb
|
|
1444
|
-
- sub/eac_cli/lib/eac_cli/speaker/constants.rb
|
|
1445
|
-
- sub/eac_cli/lib/eac_cli/speaker/input_blocked.rb
|
|
1446
|
-
- sub/eac_cli/lib/eac_cli/speaker/input_requested.rb
|
|
1447
|
-
- sub/eac_cli/lib/eac_cli/speaker/list.rb
|
|
1448
|
-
- sub/eac_cli/lib/eac_cli/speaker/options.rb
|
|
1449
|
-
- sub/eac_cli/lib/eac_cli/version.rb
|
|
1450
|
-
- sub/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb
|
|
1451
|
-
- sub/eac_cli/spec/lib/eac_cli/old_configs_spec.rb
|
|
1452
|
-
- sub/eac_cli/spec/lib/eac_cli/parser/alternative/subcommands_spec.rb
|
|
1453
|
-
- sub/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb
|
|
1454
|
-
- sub/eac_cli/spec/lib/eac_cli/runner/for_context_spec.rb
|
|
1455
|
-
- sub/eac_cli/spec/lib/eac_cli/runner_spec.rb
|
|
1456
|
-
- sub/eac_cli/spec/lib/eac_cli/runner_with/confirmation_spec.rb
|
|
1457
|
-
- sub/eac_cli/spec/lib/eac_cli/runner_with/help/layout_spec.rb
|
|
1458
|
-
- sub/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb
|
|
1459
|
-
- sub/eac_cli/spec/lib/eac_cli/runner_with/output_spec.rb
|
|
1460
|
-
- sub/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb
|
|
1461
|
-
- sub/eac_cli/spec/lib/eac_cli/speaker_spec.rb
|
|
1462
|
-
- sub/eac_cli/spec/rubocop_spec.rb
|
|
1463
|
-
- sub/eac_cli/spec/spec_helper.rb
|
|
1464
|
-
- sub/eac_config/Gemfile
|
|
1465
|
-
- sub/eac_config/eac_config.gemspec
|
|
1466
|
-
- sub/eac_config/lib/eac_config.rb
|
|
1467
|
-
- sub/eac_config/lib/eac_config/entries.rb
|
|
1468
|
-
- sub/eac_config/lib/eac_config/entry.rb
|
|
1469
|
-
- sub/eac_config/lib/eac_config/entry/not_found_error.rb
|
|
1470
|
-
- sub/eac_config/lib/eac_config/entry_path.rb
|
|
1471
|
-
- sub/eac_config/lib/eac_config/envvars_node.rb
|
|
1472
|
-
- sub/eac_config/lib/eac_config/envvars_node/entry.rb
|
|
1473
|
-
- sub/eac_config/lib/eac_config/load_nodes_search.rb
|
|
1474
|
-
- sub/eac_config/lib/eac_config/load_path.rb
|
|
1475
|
-
- sub/eac_config/lib/eac_config/node.rb
|
|
1476
|
-
- sub/eac_config/lib/eac_config/node_entry.rb
|
|
1477
|
-
- sub/eac_config/lib/eac_config/node_uri.rb
|
|
1478
|
-
- sub/eac_config/lib/eac_config/node_uri/instanciate_single.rb
|
|
1479
|
-
- sub/eac_config/lib/eac_config/old_configs.rb
|
|
1480
|
-
- sub/eac_config/lib/eac_config/old_configs/base.rb
|
|
1481
|
-
- sub/eac_config/lib/eac_config/old_configs/file.rb
|
|
1482
|
-
- sub/eac_config/lib/eac_config/paths_hash.rb
|
|
1483
|
-
- sub/eac_config/lib/eac_config/paths_hash/entry_key_error.rb
|
|
1484
|
-
- sub/eac_config/lib/eac_config/paths_hash/node.rb
|
|
1485
|
-
- sub/eac_config/lib/eac_config/paths_hash/path_search.rb
|
|
1486
|
-
- sub/eac_config/lib/eac_config/prefixed_path_node.rb
|
|
1487
|
-
- sub/eac_config/lib/eac_config/prefixed_path_node/entry.rb
|
|
1488
|
-
- sub/eac_config/lib/eac_config/rspec.rb
|
|
1489
|
-
- sub/eac_config/lib/eac_config/rspec/setup.rb
|
|
1490
|
-
- sub/eac_config/lib/eac_config/version.rb
|
|
1491
|
-
- sub/eac_config/lib/eac_config/yaml_file_node.rb
|
|
1492
|
-
- sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
|
|
1493
|
-
- sub/eac_config/lib/eac_config/yaml_file_node/self_entries.rb
|
|
1494
|
-
- sub/eac_config/spec/lib/eac_config/entry_path_spec.rb
|
|
1495
|
-
- sub/eac_config/spec/lib/eac_config/envvars_node/entry_spec.rb
|
|
1496
|
-
- sub/eac_config/spec/lib/eac_config/envvars_node_spec.rb
|
|
1497
|
-
- sub/eac_config/spec/lib/eac_config/old_configs_spec.rb
|
|
1498
|
-
- sub/eac_config/spec/lib/eac_config/paths_hash_spec.rb
|
|
1499
|
-
- sub/eac_config/spec/lib/eac_config/yaml_file_node_spec.rb
|
|
1500
|
-
- sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1.yaml
|
|
1501
|
-
- sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_1.yaml
|
|
1502
|
-
- sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2.yaml
|
|
1503
|
-
- sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2/storage1_2_1.yaml
|
|
1504
|
-
- sub/eac_config/spec/rubocop_spec.rb
|
|
1505
|
-
- sub/eac_config/spec/spec_helper.rb
|
|
1506
1376
|
- sub/eac_git/Gemfile
|
|
1507
1377
|
- sub/eac_git/eac_git.gemspec
|
|
1508
1378
|
- sub/eac_git/lib/eac_git.rb
|
data/sub/eac_cli/Gemfile
DELETED
data/sub/eac_cli/eac_cli.gemspec
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
|
4
|
-
|
|
5
|
-
require 'eac_cli/version'
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |s|
|
|
8
|
-
s.name = 'eac_cli'
|
|
9
|
-
s.version = EacCli::VERSION
|
|
10
|
-
s.authors = ['Esquilo Azul Company']
|
|
11
|
-
s.summary = 'Utilities to build CLI applications with Ruby.'
|
|
12
|
-
|
|
13
|
-
s.files = Dir['{lib}/**/*', 'Gemfile']
|
|
14
|
-
|
|
15
|
-
s.required_ruby_version = '>= 2.7.0'
|
|
16
|
-
|
|
17
|
-
s.add_dependency 'colorize', '~> 0.8', '>= 0.8.1'
|
|
18
|
-
s.add_dependency 'eac_config', '~> 0.14', '>= 0.14.1'
|
|
19
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.119', '>= 0.119.2'
|
|
20
|
-
|
|
21
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.9'
|
|
22
|
-
end
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_config/node_entry'
|
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
|
5
|
-
|
|
6
|
-
module EacCli
|
|
7
|
-
class Config < ::SimpleDelegator
|
|
8
|
-
class Entry < ::EacConfig::NodeEntry
|
|
9
|
-
class Options
|
|
10
|
-
enable_simple_cache
|
|
11
|
-
enable_listable
|
|
12
|
-
|
|
13
|
-
lists.add_symbol :type, :undefined
|
|
14
|
-
|
|
15
|
-
DEFAULT_VALUES = {
|
|
16
|
-
before_input: nil, bool: false, list: false, noecho: false, noenv: false, noinput: false,
|
|
17
|
-
required: true, store: true, type: TYPE_UNDEFINED, validator: nil
|
|
18
|
-
}.freeze
|
|
19
|
-
|
|
20
|
-
lists.add_symbol :option, *DEFAULT_VALUES.keys
|
|
21
|
-
|
|
22
|
-
common_constructor :options do
|
|
23
|
-
self.options = self.class.lists.option.hash_keys_validate!(options)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
delegate :to_h, to: :options
|
|
27
|
-
|
|
28
|
-
def [](key)
|
|
29
|
-
values.fetch(key.to_sym)
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def request_input_options
|
|
33
|
-
values.slice(:bool, :list, :noecho)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
DEFAULT_VALUES.each do |attr, default_value|
|
|
37
|
-
define_method(attr.to_s + ([true, false].include?(default_value) ? '?' : '')) do
|
|
38
|
-
self[attr]
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
private
|
|
43
|
-
|
|
44
|
-
def values_uncached
|
|
45
|
-
consumer = options.to_options_consumer
|
|
46
|
-
r = {}
|
|
47
|
-
DEFAULT_VALUES.each do |key, default_value|
|
|
48
|
-
value = consumer.consume(key)
|
|
49
|
-
value = default_value if value.nil?
|
|
50
|
-
r[key] = value
|
|
51
|
-
end
|
|
52
|
-
consumer.validate
|
|
53
|
-
r
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_cli/speaker/input_requested'
|
|
4
|
-
require 'eac_config/entry/not_found_error'
|
|
5
|
-
require 'eac_config/node_entry'
|
|
6
|
-
require 'eac_ruby_utils/core_ext'
|
|
7
|
-
|
|
8
|
-
module EacCli
|
|
9
|
-
class Config < ::SimpleDelegator
|
|
10
|
-
class Entry < ::EacConfig::NodeEntry
|
|
11
|
-
module Undefined
|
|
12
|
-
private
|
|
13
|
-
|
|
14
|
-
def undefined_value
|
|
15
|
-
loop do
|
|
16
|
-
entry_value = undefined_value_no_loop
|
|
17
|
-
next unless options[:validator].if_present(true) { |v| v.call(entry_value) }
|
|
18
|
-
|
|
19
|
-
return entry_value
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def undefined_value_no_loop
|
|
24
|
-
input("Value for entry \"#{path}\"", options.request_input_options)
|
|
25
|
-
rescue ::EacCli::Speaker::InputRequested
|
|
26
|
-
raise ::EacConfig::Entry::NotFoundError, self
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_cli/speaker'
|
|
4
|
-
require 'eac_config/entry_path'
|
|
5
|
-
require 'eac_config/node_entry'
|
|
6
|
-
require 'eac_ruby_utils/core_ext'
|
|
7
|
-
|
|
8
|
-
module EacCli
|
|
9
|
-
class Config < ::SimpleDelegator
|
|
10
|
-
class Entry < ::EacConfig::NodeEntry
|
|
11
|
-
require_sub __FILE__, include_modules: true
|
|
12
|
-
enable_listable
|
|
13
|
-
enable_simple_cache
|
|
14
|
-
enable_speaker
|
|
15
|
-
|
|
16
|
-
common_constructor :root_node, :path, :options, super_args: -> { [root_node, path] } do
|
|
17
|
-
self.options = ::EacCli::Config::Entry::Options.new(options)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# @return [EacCli::Config]
|
|
21
|
-
def config
|
|
22
|
-
root_node
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# @return [Object, nil]
|
|
26
|
-
def value
|
|
27
|
-
sub_entry.found? ? sub_value_to_return : nil
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def value!
|
|
31
|
-
return sub_value_to_return if sub_entry.found?
|
|
32
|
-
return nil unless options.required?
|
|
33
|
-
|
|
34
|
-
input_value
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def secret_value
|
|
38
|
-
self.class.new(config, path, options.to_h.merge(noecho: true).to_h).value
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
delegate :found?, :value=, to: :sub_entry
|
|
42
|
-
|
|
43
|
-
private
|
|
44
|
-
|
|
45
|
-
def sub_value_to_return
|
|
46
|
-
sub_entry.value.presence || ::EacRubyUtils::BlankNotBlank.instance
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def sub_entry_uncached
|
|
50
|
-
config.sub.entry(path)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def input_value_uncached
|
|
54
|
-
r = send("#{options.type}_value")
|
|
55
|
-
sub_entry.value = r if options.store?
|
|
56
|
-
r
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
|
4
|
-
|
|
5
|
-
module EacCli
|
|
6
|
-
class Config < ::SimpleDelegator
|
|
7
|
-
require_sub __FILE__
|
|
8
|
-
|
|
9
|
-
def entry(path, options = {})
|
|
10
|
-
::EacCli::Config::Entry.new(self, path, options)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def sub
|
|
14
|
-
__getobj__
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_cli/runner_with/help'
|
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
|
5
|
-
|
|
6
|
-
module EacCli
|
|
7
|
-
module DefaultRunner
|
|
8
|
-
common_concern do
|
|
9
|
-
include ::EacCli::RunnerWith::Help
|
|
10
|
-
enable_speaker
|
|
11
|
-
enable_simple_cache
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_cli/definition/argument_option'
|
|
4
|
-
require 'eac_cli/definition/boolean_option'
|
|
5
|
-
require 'eac_cli/definition/positional'
|
|
6
|
-
|
|
7
|
-
module EacCli
|
|
8
|
-
class Definition
|
|
9
|
-
class Alternative
|
|
10
|
-
ANY_OPTION_DESCRIPTION = 'ANY_OPTION'
|
|
11
|
-
ANY_OPTION_LONG = '__'
|
|
12
|
-
ANY_OPTION_SHORT = '_'
|
|
13
|
-
SUBCOMMAND_NAME_ARG = :subcommand
|
|
14
|
-
SUBCOMMAND_ARGS_ARG = :subcommand_args
|
|
15
|
-
|
|
16
|
-
# @return [Boolean]
|
|
17
|
-
def any_opt
|
|
18
|
-
@any_opt = true
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
# @return [Boolean]
|
|
22
|
-
def any_option?
|
|
23
|
-
@any_opt ? true : false
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
# @return [EacCli::Definition::BooleanOption]
|
|
27
|
-
def any_options_option
|
|
28
|
-
@any_options_option ||= ::EacCli::Definition::BooleanOption.new(
|
|
29
|
-
ANY_OPTION_SHORT, ANY_OPTION_LONG, ANY_OPTION_DESCRIPTION,
|
|
30
|
-
optional: true, repeat: true, usage: false
|
|
31
|
-
)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def arg_opt(*args)
|
|
35
|
-
options_set << ::EacCli::Definition::ArgumentOption.from_args(args)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def bool_opt(*args)
|
|
39
|
-
options_set << ::EacCli::Definition::BooleanOption.from_args(args)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def options
|
|
43
|
-
options_set.to_a
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def options_argument?
|
|
47
|
-
@options_argument ? true : false
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def options_argument(enable)
|
|
51
|
-
@options_argument = enable
|
|
52
|
-
|
|
53
|
-
self
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def pos_arg(name, arg_options = {})
|
|
57
|
-
new_pos_arg = ::EacCli::Definition::Positional.new(name, arg_options)
|
|
58
|
-
check_positional_blocked(new_pos_arg)
|
|
59
|
-
pos_set << new_pos_arg
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def positional
|
|
63
|
-
pos_set.to_a
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def positional_arguments_blocked_reason(new_pos_arg)
|
|
67
|
-
last = pos_set.last
|
|
68
|
-
return nil unless last
|
|
69
|
-
return 'there are subcommands' if subcommands?
|
|
70
|
-
return 'last argument repeats' if last.repeat?
|
|
71
|
-
return 'new argument is required and last is optional' if
|
|
72
|
-
last.optional? && new_pos_arg.if_present(&:required?)
|
|
73
|
-
|
|
74
|
-
nil
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
def subcommands
|
|
78
|
-
pos_arg(SUBCOMMAND_NAME_ARG, subcommand: true)
|
|
79
|
-
pos_set << ::EacCli::Definition::Positional.new(SUBCOMMAND_ARGS_ARG,
|
|
80
|
-
optional: true, repeat: true)
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
def subcommands?
|
|
84
|
-
pos_set.any?(&:subcommand?)
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
private
|
|
88
|
-
|
|
89
|
-
def check_positional_blocked(new_pos_arg)
|
|
90
|
-
positional_arguments_blocked_reason(new_pos_arg).if_present do |v|
|
|
91
|
-
raise ::EacCli::Definition::Error, "Positional arguments are blocked: #{v} " \
|
|
92
|
-
"(New argument: #{new_pos_arg})"
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
def pos_set
|
|
97
|
-
@pos_set ||= []
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
def options_set
|
|
101
|
-
@options_set ||= []
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
end
|
|
105
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_cli/definition/option'
|
|
4
|
-
|
|
5
|
-
module EacCli
|
|
6
|
-
class Definition
|
|
7
|
-
class ArgumentOption < ::EacCli::Definition::Option
|
|
8
|
-
def argument?
|
|
9
|
-
true
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def build_value(new_value, previous_value)
|
|
13
|
-
repeat? ? previous_value + [new_value] : new_value
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def default_default_value
|
|
17
|
-
repeat? ? [] : nil
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|