eac_tools 0.104.0 → 0.105.1
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 +41 -41
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm-tools/README.textile +28 -0
- data/sub/avm-tools/avm-tools.gemspec +25 -0
- data/sub/avm-tools/exe/avm +6 -0
- data/sub/{avm/template/avm/rspec/launcher_controller/dummy/ruby_gem_stub/lib/ruby_gem_stub.rb → avm-tools/lib/avm/tools/core_ext.rb} +0 -2
- data/sub/avm-tools/lib/avm/tools/rspec/helpers/runner.rb +19 -0
- data/sub/avm-tools/lib/avm/tools/rspec/setup.rb +21 -0
- data/sub/avm-tools/lib/avm/tools/runner/application/info.rb +34 -0
- data/sub/avm-tools/lib/avm/tools/runner/application.rb +23 -0
- data/sub/avm-tools/lib/avm/tools/runner/application_stereotypes/list.rb +29 -0
- data/sub/avm-tools/lib/avm/tools/runner/application_stereotypes.rb +14 -0
- data/sub/avm-tools/lib/avm/tools/runner/applications/list.rb +29 -0
- data/sub/avm-tools/lib/avm/tools/runner/applications.rb +14 -0
- data/sub/avm-tools/lib/avm/tools/runner/config/load_path.rb +48 -0
- data/sub/avm-tools/lib/avm/tools/runner/config.rb +15 -0
- data/sub/avm-tools/lib/avm/tools/runner/files/format.rb +46 -0
- data/sub/avm-tools/lib/avm/tools/runner/files/rotate.rb +28 -0
- data/sub/avm-tools/lib/avm/tools/runner/files.rb +15 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/clear.rb +15 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/dump.rb +17 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/load.rb +22 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/unit/clear.rb +17 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/unit/dump.rb +17 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/unit/load.rb +22 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/unit.rb +41 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data.rb +24 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/entry.rb +41 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/info.rb +35 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/system.rb +63 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance.rb +11 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher/instances.rb +34 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher/projects.rb +37 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb +51 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher.rb +15 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher_stereotypes/list.rb +38 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher_stereotypes.rb +14 -0
- data/sub/avm-tools/lib/avm/tools/runner/self/docker.rb +12 -0
- data/sub/avm-tools/lib/avm/tools/runner/self/registry.rb +22 -0
- data/sub/avm-tools/lib/avm/tools/runner/self.rb +19 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/auto_commit.rb +67 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/info.rb +53 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/issue/complete.rb +85 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/issue/deliver.rb +32 -0
- data/sub/{avm-git/lib/avm/git/runners/base/subrepo.rb → avm-tools/lib/avm/tools/runner/source/issue.rb} +5 -5
- data/sub/avm-tools/lib/avm/tools/runner/source/sub/remove.rb +20 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/sub.rb +27 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/subs.rb +70 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/test.rb +90 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/update.rb +20 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/version_bump.rb +78 -0
- data/sub/avm-tools/lib/avm/tools/runner/source.rb +15 -0
- data/sub/avm-tools/lib/avm/tools/runner/source_generate.rb +10 -0
- data/sub/avm-tools/lib/avm/tools/runner.rb +20 -0
- data/sub/avm-tools/lib/avm/tools/runner_with/include_exclude.rb +20 -0
- data/sub/avm-tools/lib/avm/tools/runner_with/instance_data_clear.rb +19 -0
- data/sub/avm-tools/lib/avm/tools/runner_with/instance_data_dump.rb +55 -0
- data/sub/avm-tools/lib/avm/tools/runner_with/instance_data_load.rb +64 -0
- data/sub/avm-tools/lib/avm/tools/runner_with/instance_data_performer.rb +37 -0
- data/sub/avm-tools/lib/avm/tools/runner_with.rb +9 -0
- data/sub/avm-tools/lib/avm/tools/self.rb +19 -0
- data/sub/{avm/template/avm/rspec/launcher_controller/dummy/avm-tools_stub/lib/avm/tools.rb → avm-tools/lib/avm/tools/version.rb} +1 -0
- data/sub/avm-tools/lib/avm/tools.rb +16 -0
- data/sub/avm-tools/spec/lib/avm/tools/runner/files/rotate_spec.rb +71 -0
- data/sub/avm-tools/spec/lib/avm/tools/runner/launcher_stereotypes/list_spec.rb +15 -0
- data/sub/avm-tools/spec/lib/avm/tools/runner/source/issue/complete_spec.rb +47 -0
- data/sub/avm-tools/spec/lib/avm/tools/runner_spec.rb +12 -0
- data/sub/{avm-git → avm-tools}/spec/spec_helper.rb +3 -1
- data/sub/eac_cli/eac_cli.gemspec +23 -0
- data/sub/eac_cli/lib/eac_cli/config/entry/options.rb +55 -0
- data/sub/eac_cli/lib/eac_cli/config/entry/undefined.rb +26 -0
- data/sub/eac_cli/lib/eac_cli/config/entry.rb +55 -0
- data/sub/eac_cli/lib/eac_cli/config.rb +15 -0
- data/sub/eac_cli/lib/eac_cli/core_ext.rb +3 -0
- data/sub/eac_cli/lib/eac_cli/default_runner.rb +12 -0
- data/sub/eac_cli/lib/eac_cli/definition/alternative.rb +101 -0
- data/sub/eac_cli/lib/eac_cli/definition/argument_option.rb +19 -0
- data/sub/eac_cli/lib/eac_cli/definition/boolean_option.rb +25 -0
- data/sub/eac_cli/lib/eac_cli/definition/error.rb +8 -0
- data/sub/eac_cli/lib/eac_cli/definition/option/initialize_args_parser.rb +48 -0
- data/sub/eac_cli/lib/eac_cli/definition/option.rb +70 -0
- data/sub/eac_cli/lib/eac_cli/definition/option_or_positional.rb +41 -0
- data/sub/eac_cli/lib/eac_cli/definition/positional.rb +50 -0
- data/sub/eac_cli/lib/eac_cli/definition.rb +104 -0
- data/sub/eac_cli/lib/eac_cli/enum.rb +44 -0
- data/sub/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +76 -0
- data/sub/eac_cli/lib/eac_cli/old_configs/password_entry_reader.rb +14 -0
- data/sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +42 -0
- data/sub/eac_cli/lib/eac_cli/old_configs/store_passwords_entry_reader.rb +23 -0
- data/sub/eac_cli/lib/eac_cli/old_configs.rb +31 -0
- data/sub/eac_cli/lib/eac_cli/parser/alternative/any_options.rb +17 -0
- data/sub/eac_cli/lib/eac_cli/parser/alternative/argv.rb +19 -0
- data/sub/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb +24 -0
- data/sub/eac_cli/lib/eac_cli/parser/alternative/long_options.rb +37 -0
- data/sub/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb +29 -0
- data/sub/eac_cli/lib/eac_cli/parser/alternative/options.rb +29 -0
- data/sub/eac_cli/lib/eac_cli/parser/alternative/positionals.rb +30 -0
- data/sub/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +54 -0
- data/sub/eac_cli/lib/eac_cli/parser/alternative.rb +99 -0
- data/sub/eac_cli/lib/eac_cli/parser/collector.rb +52 -0
- data/sub/eac_cli/lib/eac_cli/parser/error.rb +13 -0
- data/sub/eac_cli/lib/eac_cli/parser.rb +32 -0
- data/sub/eac_cli/lib/eac_cli/patches/object/runner_with.rb +22 -0
- data/sub/eac_cli/lib/eac_cli/patches/object.rb +5 -0
- data/sub/{avm-git/lib/avm/git/issue.rb → eac_cli/lib/eac_cli/patches.rb} +0 -7
- data/sub/eac_cli/lib/eac_cli/rspec/setup.rb +41 -0
- data/sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb +34 -0
- data/sub/eac_cli/lib/eac_cli/runner/class_runner.rb +32 -0
- data/sub/eac_cli/lib/eac_cli/runner/context.rb +57 -0
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/base.rb +22 -0
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/parent.rb +24 -0
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/runner.rb +17 -0
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/runner_missing_method.rb +29 -0
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/set.rb +41 -0
- data/sub/eac_cli/lib/eac_cli/runner/exit.rb +14 -0
- data/sub/eac_cli/lib/eac_cli/runner/for_context.rb +35 -0
- data/sub/eac_cli/lib/eac_cli/runner/instance_methods.rb +45 -0
- data/sub/eac_cli/lib/eac_cli/runner.rb +47 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/confirmation/input_result.rb +60 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/confirmation.rb +65 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/help/builder/alternative.rb +61 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +79 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/help/layout.rb +38 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/help.rb +51 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/input.rb +32 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/output.rb +54 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/asciidoc_formatter.rb +70 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/base_formatter.rb +12 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/csv_formatter.rb +21 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/yaml_formatter.rb +16 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item.rb +47 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list/base_formatter.rb +44 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb +24 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list/tty_formatter.rb +34 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list/yaml_formatter.rb +21 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list.rb +39 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/subcommands/definition_concern.rb +10 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +124 -0
- data/sub/{avm/lib/avm → eac_cli/lib/eac_cli}/runner_with.rb +1 -3
- data/sub/eac_cli/lib/eac_cli/runner_with_set/from_gems_registry.rb +14 -0
- data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +48 -0
- data/sub/eac_cli/lib/eac_cli/speaker/constants.rb +11 -0
- data/sub/eac_cli/lib/eac_cli/speaker/input_blocked.rb +14 -0
- data/sub/eac_cli/lib/eac_cli/speaker/input_requested.rb +8 -0
- data/sub/eac_cli/lib/eac_cli/speaker/list.rb +84 -0
- data/sub/eac_cli/lib/eac_cli/speaker/options.rb +42 -0
- data/sub/eac_cli/lib/eac_cli/speaker/request_from_list.rb +40 -0
- data/sub/eac_cli/lib/eac_cli/speaker.rb +114 -0
- data/sub/{avm/lib/avm → eac_cli/lib/eac_cli}/version.rb +2 -2
- data/sub/eac_cli/lib/eac_cli.rb +14 -0
- data/sub/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +18 -0
- data/sub/eac_cli/spec/lib/eac_cli/old_configs_spec.rb +14 -0
- data/sub/eac_cli/spec/lib/eac_cli/parser/alternative/subcommands_spec.rb +58 -0
- data/sub/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb +89 -0
- data/sub/eac_cli/spec/lib/eac_cli/runner/for_context_spec.rb +79 -0
- data/sub/eac_cli/spec/lib/eac_cli/runner_spec.rb +129 -0
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/confirmation/input_result_spec.rb +36 -0
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/confirmation_spec.rb +42 -0
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/help/layout_spec.rb +21 -0
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +51 -0
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/output_list_spec.rb +57 -0
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/output_spec.rb +81 -0
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb +99 -0
- data/sub/eac_cli/spec/lib/eac_cli/speaker_spec.rb +36 -0
- data/sub/eac_cli/spec/spec_helper.rb +4 -0
- metadata +187 -398
- data/sub/avm/avm.gemspec +0 -28
- data/sub/avm/lib/avm/application_scms/base.rb +0 -37
- data/sub/avm/lib/avm/application_scms.rb +0 -6
- data/sub/avm/lib/avm/application_stereotypes/base.rb +0 -29
- data/sub/avm/lib/avm/application_stereotypes.rb +0 -6
- data/sub/avm/lib/avm/applications/base/auto_local_source_path.rb +0 -22
- data/sub/avm/lib/avm/applications/base/local_instance.rb +0 -28
- data/sub/avm/lib/avm/applications/base/local_source.rb +0 -33
- data/sub/avm/lib/avm/applications/base/naming.rb +0 -26
- data/sub/avm/lib/avm/applications/base/organization.rb +0 -27
- data/sub/avm/lib/avm/applications/base/publishing.rb +0 -39
- data/sub/avm/lib/avm/applications/base/scm.rb +0 -24
- data/sub/avm/lib/avm/applications/base/stereotype.rb +0 -29
- data/sub/avm/lib/avm/applications/base.rb +0 -34
- data/sub/avm/lib/avm/applications.rb +0 -6
- data/sub/avm/lib/avm/data/callbacks.rb +0 -36
- data/sub/avm/lib/avm/data/clearer.rb +0 -17
- data/sub/avm/lib/avm/data/dumper.rb +0 -137
- data/sub/avm/lib/avm/data/loader.rb +0 -23
- data/sub/avm/lib/avm/data/package/base_performer.rb +0 -36
- data/sub/avm/lib/avm/data/package/build_directory.rb +0 -25
- data/sub/avm/lib/avm/data/package/clear.rb +0 -19
- data/sub/avm/lib/avm/data/package/dump.rb +0 -42
- data/sub/avm/lib/avm/data/package/load.rb +0 -33
- data/sub/avm/lib/avm/data/package.rb +0 -64
- data/sub/avm/lib/avm/data/performer.rb +0 -45
- data/sub/avm/lib/avm/data/rotate.rb +0 -106
- data/sub/avm/lib/avm/data/unit.rb +0 -44
- data/sub/avm/lib/avm/data/unit_with_commands.rb +0 -48
- data/sub/avm/lib/avm/docker/container.rb +0 -49
- data/sub/avm/lib/avm/docker/image.rb +0 -73
- data/sub/avm/lib/avm/docker/runner.rb +0 -131
- data/sub/avm/lib/avm/docker.rb +0 -6
- data/sub/avm/lib/avm/entries/auto_values/entry.rb +0 -38
- data/sub/avm/lib/avm/entries/auto_values/uri_entry.rb +0 -21
- data/sub/avm/lib/avm/entries/auto_values.rb +0 -8
- data/sub/avm/lib/avm/entries/base/inherited_entry_value.rb +0 -44
- data/sub/avm/lib/avm/entries/base/uri_component_entry_value/default_value.rb +0 -26
- data/sub/avm/lib/avm/entries/base/uri_component_entry_value/inherited_value.rb +0 -37
- data/sub/avm/lib/avm/entries/base/uri_component_entry_value/url_entry_value.rb +0 -29
- data/sub/avm/lib/avm/entries/base/uri_component_entry_value.rb +0 -42
- data/sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb +0 -40
- data/sub/avm/lib/avm/entries/base/uri_components_entries_values/generic_component.rb +0 -59
- data/sub/avm/lib/avm/entries/base/uri_components_entries_values/path_component.rb +0 -16
- data/sub/avm/lib/avm/entries/base/uri_components_entries_values/url_component.rb +0 -24
- data/sub/avm/lib/avm/entries/base/uri_components_entries_values.rb +0 -23
- data/sub/avm/lib/avm/entries/base.rb +0 -55
- data/sub/avm/lib/avm/entries/entry/no_context_entry.rb +0 -21
- data/sub/avm/lib/avm/entries/entry.rb +0 -71
- data/sub/avm/lib/avm/entries/jobs/base.rb +0 -60
- data/sub/avm/lib/avm/entries/jobs/variables_source/read_entry.rb +0 -48
- data/sub/avm/lib/avm/entries/jobs/variables_source.rb +0 -13
- data/sub/avm/lib/avm/entries/jobs/with_variables_source.rb +0 -13
- data/sub/avm/lib/avm/entries/jobs.rb +0 -8
- data/sub/avm/lib/avm/entries/keys_constants_set.rb +0 -41
- data/sub/avm/lib/avm/entries/uri_builder.rb +0 -87
- data/sub/avm/lib/avm/entries.rb +0 -6
- data/sub/avm/lib/avm/executables.rb +0 -21
- data/sub/avm/lib/avm/file_formats/base.rb +0 -34
- data/sub/avm/lib/avm/file_formats/file_result.rb +0 -11
- data/sub/avm/lib/avm/file_formats/search_formatter.rb +0 -83
- data/sub/avm/lib/avm/file_formats/unknown.rb +0 -15
- data/sub/avm/lib/avm/file_formats/utf8_assert.rb +0 -70
- data/sub/avm/lib/avm/file_formats.rb +0 -6
- data/sub/avm/lib/avm/files/appendable/file_content.rb +0 -30
- data/sub/avm/lib/avm/files/appendable/plain_directory.rb +0 -29
- data/sub/avm/lib/avm/files/appendable/resource_base.rb +0 -19
- data/sub/avm/lib/avm/files/appendable/tar_output_command.rb +0 -30
- data/sub/avm/lib/avm/files/appendable/templatized_directory.rb +0 -40
- data/sub/avm/lib/avm/files/appendable.rb +0 -55
- data/sub/avm/lib/avm/files/appender.rb +0 -9
- data/sub/avm/lib/avm/files/deploy.rb +0 -72
- data/sub/avm/lib/avm/files/text_replacer/gsub.rb +0 -24
- data/sub/avm/lib/avm/files/text_replacer.rb +0 -32
- data/sub/avm/lib/avm/instances/base/auto_values/data.rb +0 -28
- data/sub/avm/lib/avm/instances/base/auto_values/database.rb +0 -60
- data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +0 -31
- data/sub/avm/lib/avm/instances/base/auto_values/source.rb +0 -16
- data/sub/avm/lib/avm/instances/base/auto_values.rb +0 -12
- data/sub/avm/lib/avm/instances/base/dockerizable.rb +0 -43
- data/sub/avm/lib/avm/instances/base/entry_keys.rb +0 -25
- data/sub/avm/lib/avm/instances/base/install.rb +0 -28
- data/sub/avm/lib/avm/instances/base/processes.rb +0 -25
- data/sub/avm/lib/avm/instances/base/production.rb +0 -33
- data/sub/avm/lib/avm/instances/base/subcommand_parent.rb +0 -25
- data/sub/avm/lib/avm/instances/base/web.rb +0 -15
- data/sub/avm/lib/avm/instances/base.rb +0 -70
- data/sub/avm/lib/avm/instances/data/files_unit.rb +0 -57
- data/sub/avm/lib/avm/instances/data/loading_denied_error.rb +0 -10
- data/sub/avm/lib/avm/instances/data/package.rb +0 -25
- data/sub/avm/lib/avm/instances/data/unit.rb +0 -36
- data/sub/avm/lib/avm/instances/data.rb +0 -8
- data/sub/avm/lib/avm/instances/docker_image.rb +0 -13
- data/sub/avm/lib/avm/instances/entry_keys.rb +0 -39
- data/sub/avm/lib/avm/instances/ids.rb +0 -28
- data/sub/avm/lib/avm/instances/process.rb +0 -29
- data/sub/avm/lib/avm/instances/runner.rb +0 -36
- data/sub/avm/lib/avm/instances.rb +0 -6
- data/sub/avm/lib/avm/launcher/context/instance_collector.rb +0 -44
- data/sub/avm/lib/avm/launcher/context/instance_discovery/root_instance_paths.rb +0 -51
- data/sub/avm/lib/avm/launcher/context/instance_discovery.rb +0 -53
- data/sub/avm/lib/avm/launcher/context/instance_manager/cached_instance.rb +0 -34
- data/sub/avm/lib/avm/launcher/context/instance_manager/cached_instances.rb +0 -32
- data/sub/avm/lib/avm/launcher/context/instance_manager.rb +0 -74
- data/sub/avm/lib/avm/launcher/context/settings.rb +0 -51
- data/sub/avm/lib/avm/launcher/context.rb +0 -85
- data/sub/avm/lib/avm/launcher/errors/base.rb +0 -10
- data/sub/avm/lib/avm/launcher/errors/non_project.rb +0 -13
- data/sub/avm/lib/avm/launcher/errors.rb +0 -8
- data/sub/avm/lib/avm/launcher/instances/base/cache.rb +0 -43
- data/sub/avm/lib/avm/launcher/instances/base/publishing.rb +0 -53
- data/sub/avm/lib/avm/launcher/instances/base.rb +0 -77
- data/sub/avm/lib/avm/launcher/instances/error.rb +0 -10
- data/sub/avm/lib/avm/launcher/instances/runner_helper.rb +0 -43
- data/sub/avm/lib/avm/launcher/instances/settings.rb +0 -24
- data/sub/avm/lib/avm/launcher/instances.rb +0 -8
- data/sub/avm/lib/avm/launcher/paths/logical.rb +0 -76
- data/sub/avm/lib/avm/launcher/paths/real.rb +0 -44
- data/sub/avm/lib/avm/launcher/paths.rb +0 -8
- data/sub/avm/lib/avm/launcher/project.rb +0 -15
- data/sub/avm/lib/avm/launcher/publish/base.rb +0 -44
- data/sub/avm/lib/avm/launcher/publish/check_result.rb +0 -64
- data/sub/avm/lib/avm/launcher/publish.rb +0 -8
- data/sub/avm/lib/avm/launcher/stereotype.rb +0 -63
- data/sub/avm/lib/avm/launcher.rb +0 -6
- data/sub/avm/lib/avm/launcher_stereotypes.rb +0 -6
- data/sub/avm/lib/avm/patches/eac_config/entry_path.rb +0 -46
- data/sub/avm/lib/avm/path_string.rb +0 -27
- data/sub/avm/lib/avm/registry/application_scms.rb +0 -13
- data/sub/avm/lib/avm/registry/application_stereotypes/build_available.rb +0 -45
- data/sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb +0 -30
- data/sub/avm/lib/avm/registry/application_stereotypes.rb +0 -42
- data/sub/avm/lib/avm/registry/applications.rb +0 -35
- data/sub/avm/lib/avm/registry/base.rb +0 -26
- data/sub/avm/lib/avm/registry/config_objects.rb +0 -15
- data/sub/avm/lib/avm/registry/detection_error.rb +0 -8
- data/sub/avm/lib/avm/registry/file_formats.rb +0 -17
- data/sub/avm/lib/avm/registry/from_gems.rb +0 -67
- data/sub/avm/lib/avm/registry/instances.rb +0 -13
- data/sub/avm/lib/avm/registry/launcher_stereotypes.rb +0 -8
- data/sub/avm/lib/avm/registry/runners.rb +0 -8
- data/sub/avm/lib/avm/registry/scms.rb +0 -8
- data/sub/avm/lib/avm/registry/source_generators.rb +0 -14
- data/sub/avm/lib/avm/registry/sources.rb +0 -38
- data/sub/avm/lib/avm/registry/with_path/cache.rb +0 -28
- data/sub/avm/lib/avm/registry/with_path.rb +0 -46
- data/sub/avm/lib/avm/registry.rb +0 -32
- data/sub/avm/lib/avm/result.rb +0 -80
- data/sub/avm/lib/avm/rspec/launcher_controller.rb +0 -95
- data/sub/avm/lib/avm/rspec/setup/launcher.rb +0 -18
- data/sub/avm/lib/avm/rspec/setup/source_generator.rb +0 -20
- data/sub/avm/lib/avm/rspec/setup.rb +0 -32
- data/sub/avm/lib/avm/rspec/shared_examples/avm_file_format_file_resource_name.rb +0 -13
- data/sub/avm/lib/avm/rspec/shared_examples/avm_file_formats_with_fixtures.rb +0 -28
- data/sub/avm/lib/avm/rspec/shared_examples/avm_source_generated.rb +0 -23
- data/sub/avm/lib/avm/rspec/shared_examples/entries_values.rb +0 -19
- data/sub/avm/lib/avm/rspec/shared_examples/in_avm_registry.rb +0 -9
- data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +0 -12
- data/sub/avm/lib/avm/rspec/shared_examples/with_config.rb +0 -9
- data/sub/avm/lib/avm/rspec/shared_examples/with_launcher.rb +0 -13
- data/sub/avm/lib/avm/rspec.rb +0 -6
- data/sub/avm/lib/avm/runner_with/file_replacer.rb +0 -30
- data/sub/avm/lib/avm/runner_with/filesystem_renamer.rb +0 -101
- data/sub/avm/lib/avm/runner_with/filesystem_traverser.rb +0 -54
- data/sub/avm/lib/avm/runners/base.rb +0 -27
- data/sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb +0 -47
- data/sub/avm/lib/avm/scms/auto_commit/for_file.rb +0 -79
- data/sub/avm/lib/avm/scms/auto_commit/rules/base.rb +0 -37
- data/sub/avm/lib/avm/scms/auto_commit/rules/last.rb +0 -17
- data/sub/avm/lib/avm/scms/auto_commit/rules/manual.rb +0 -38
- data/sub/avm/lib/avm/scms/auto_commit/rules/new.rb +0 -21
- data/sub/avm/lib/avm/scms/auto_commit/rules/nth.rb +0 -29
- data/sub/avm/lib/avm/scms/auto_commit/rules/unique.rb +0 -19
- data/sub/avm/lib/avm/scms/auto_commit/rules.rb +0 -34
- data/sub/avm/lib/avm/scms/auto_commit.rb +0 -8
- data/sub/avm/lib/avm/scms/base/branches.rb +0 -20
- data/sub/avm/lib/avm/scms/base/commits.rb +0 -32
- data/sub/avm/lib/avm/scms/base/milestones.rb +0 -19
- data/sub/avm/lib/avm/scms/base/remotes.rb +0 -20
- data/sub/avm/lib/avm/scms/base.rb +0 -59
- data/sub/avm/lib/avm/scms/branch.rb +0 -24
- data/sub/avm/lib/avm/scms/changed_file.rb +0 -46
- data/sub/avm/lib/avm/scms/commit.rb +0 -64
- data/sub/avm/lib/avm/scms/commit_info.rb +0 -37
- data/sub/avm/lib/avm/scms/inflector.rb +0 -22
- data/sub/avm/lib/avm/scms/interval.rb +0 -16
- data/sub/avm/lib/avm/scms/null/commit.rb +0 -11
- data/sub/avm/lib/avm/scms/null.rb +0 -16
- data/sub/avm/lib/avm/scms/remote.rb +0 -9
- data/sub/avm/lib/avm/scms.rb +0 -6
- data/sub/avm/lib/avm/self/docker_image.rb +0 -11
- data/sub/avm/lib/avm/self/instance/entry_keys.rb +0 -12
- data/sub/avm/lib/avm/self/instance.rb +0 -27
- data/sub/avm/lib/avm/source_generators/base.rb +0 -69
- data/sub/avm/lib/avm/source_generators/option.rb +0 -11
- data/sub/avm/lib/avm/source_generators/option_list.rb +0 -29
- data/sub/avm/lib/avm/source_generators/runner.rb +0 -57
- data/sub/avm/lib/avm/source_generators.rb +0 -6
- data/sub/avm/lib/avm/sources/auto_commit/for_file.rb +0 -29
- data/sub/avm/lib/avm/sources/auto_commit.rb +0 -8
- data/sub/avm/lib/avm/sources/base/application.rb +0 -34
- data/sub/avm/lib/avm/sources/base/configuration.rb +0 -91
- data/sub/avm/lib/avm/sources/base/instance.rb +0 -13
- data/sub/avm/lib/avm/sources/base/locale.rb +0 -30
- data/sub/avm/lib/avm/sources/base/organizational.rb +0 -30
- data/sub/avm/lib/avm/sources/base/parent.rb +0 -26
- data/sub/avm/lib/avm/sources/base/stereotype.rb +0 -16
- data/sub/avm/lib/avm/sources/base/sub/remove.rb +0 -36
- data/sub/avm/lib/avm/sources/base/sub.rb +0 -23
- data/sub/avm/lib/avm/sources/base/subs.rb +0 -63
- data/sub/avm/lib/avm/sources/base/subs_paths.rb +0 -30
- data/sub/avm/lib/avm/sources/base/testing.rb +0 -67
- data/sub/avm/lib/avm/sources/base/update.rb +0 -37
- data/sub/avm/lib/avm/sources/base/update_sub.rb +0 -55
- data/sub/avm/lib/avm/sources/base/update_subs.rb +0 -17
- data/sub/avm/lib/avm/sources/base/version_bump.rb +0 -26
- data/sub/avm/lib/avm/sources/base.rb +0 -56
- data/sub/avm/lib/avm/sources/configuration/rubocop.rb +0 -26
- data/sub/avm/lib/avm/sources/configuration.rb +0 -59
- data/sub/avm/lib/avm/sources/issues/deliver.rb +0 -52
- data/sub/avm/lib/avm/sources/issues.rb +0 -8
- data/sub/avm/lib/avm/sources/runner.rb +0 -40
- data/sub/avm/lib/avm/sources/tests/builder.rb +0 -91
- data/sub/avm/lib/avm/sources/tests/performer.rb +0 -32
- data/sub/avm/lib/avm/sources/tests/result.rb +0 -15
- data/sub/avm/lib/avm/sources/tests/single.rb +0 -71
- data/sub/avm/lib/avm/sources/tests.rb +0 -8
- data/sub/avm/lib/avm/sources/update_error.rb +0 -8
- data/sub/avm/lib/avm/sources.rb +0 -6
- data/sub/avm/lib/avm/sync.rb +0 -90
- data/sub/avm/lib/avm/version_number.rb +0 -45
- data/sub/avm/lib/avm/with/application_stereotype.rb +0 -29
- data/sub/avm/lib/avm/with/extra_subcommands.rb +0 -43
- data/sub/avm/lib/avm.rb +0 -12
- data/sub/avm/locale/en.yml +0 -6
- data/sub/avm/locale/pt-BR.yml +0 -6
- data/sub/avm/spec/lib/avm/applications/base/entries_spec.rb +0 -29
- data/sub/avm/spec/lib/avm/applications/base/entries_spec_files/config.yml +0 -12
- data/sub/avm/spec/lib/avm/applications/base_spec.rb +0 -21
- data/sub/avm/spec/lib/avm/applications/base_spec_fixture.yml +0 -3
- data/sub/avm/spec/lib/avm/file_formats/base_spec.rb +0 -9
- data/sub/avm/spec/lib/avm/instances/base_spec.rb +0 -104
- data/sub/avm/spec/lib/avm/instances/base_spec_files/config.yml +0 -50
- data/sub/avm/spec/lib/avm/launcher/context_spec.rb +0 -98
- data/sub/avm/spec/lib/avm/launcher/context_spec.yml +0 -5
- data/sub/avm/spec/lib/avm/launcher/context_spec_files/config.yml +0 -9
- data/sub/avm/spec/lib/avm/launcher/instances/base_spec.rb +0 -39
- data/sub/avm/spec/lib/avm/launcher/instances/base_spec_files/config.yml +0 -5
- data/sub/avm/spec/lib/avm/launcher/instances/base_spec_files/settings.yaml +0 -5
- data/sub/avm/spec/lib/avm/patches/eac_config/entry_path_spec.rb +0 -26
- data/sub/avm/spec/lib/avm/scms/auto_commit/file_resource_name_spec.rb +0 -20
- data/sub/avm/spec/lib/avm/scms/base_spec.rb +0 -5
- data/sub/avm/spec/lib/avm/sources/base_spec.rb +0 -5
- data/sub/avm/spec/lib/avm/sources/runner_spec.rb +0 -7
- data/sub/avm/spec/spec_helper/launcher_context/settings.yml +0 -6
- data/sub/avm/spec/spec_helper.rb +0 -8
- data/sub/avm/template/avm/rspec/launcher_controller/dummy/avm-tools_stub/avm-tools.gemspec +0 -29
- data/sub/avm/template/avm/rspec/launcher_controller/dummy/avm-tools_stub/lib/avm/tools/version.rb +0 -7
- data/sub/avm/template/avm/rspec/launcher_controller/dummy/ruby_gem_stub/lib/ruby_gem_stub/version.rb +0 -5
- data/sub/avm/template/avm/rspec/launcher_controller/dummy/ruby_gem_stub/ruby_gem_stub.gemspec +0 -16
- data/sub/avm/template/avm/rspec/launcher_controller/settings.yml +0 -1
- data/sub/avm/template/avm/self/docker_image/Dockerfile +0 -17
- data/sub/avm/template/avm/self/docker_image/entrypoint.sh +0 -12
- data/sub/avm-git/avm-git.gemspec +0 -25
- data/sub/avm-git/lib/avm/git/application_scms/base/assert_main_at.rb +0 -44
- data/sub/avm-git/lib/avm/git/application_scms/base.rb +0 -18
- data/sub/avm-git/lib/avm/git/application_scms.rb +0 -9
- data/sub/avm-git/lib/avm/git/commit/class_methods.rb +0 -29
- data/sub/avm-git/lib/avm/git/commit/diff_tree_line.rb +0 -32
- data/sub/avm-git/lib/avm/git/commit/file.rb +0 -42
- data/sub/avm-git/lib/avm/git/commit.rb +0 -57
- data/sub/avm-git/lib/avm/git/issue/complete/commits.rb +0 -40
- data/sub/avm-git/lib/avm/git/issue/complete/git_subrepos.rb +0 -20
- data/sub/avm-git/lib/avm/git/issue/complete/local_branch.rb +0 -59
- data/sub/avm-git/lib/avm/git/issue/complete/local_tag.rb +0 -37
- data/sub/avm-git/lib/avm/git/issue/complete/push.rb +0 -60
- data/sub/avm-git/lib/avm/git/issue/complete/remote.rb +0 -33
- data/sub/avm-git/lib/avm/git/issue/complete/test.rb +0 -34
- data/sub/avm-git/lib/avm/git/issue/complete/tracker.rb +0 -21
- data/sub/avm-git/lib/avm/git/issue/complete/validation.rb +0 -36
- data/sub/avm-git/lib/avm/git/issue/complete/validations.rb +0 -54
- data/sub/avm-git/lib/avm/git/issue/complete/working_tree.rb +0 -19
- data/sub/avm-git/lib/avm/git/issue/complete.rb +0 -66
- data/sub/avm-git/lib/avm/git/launcher/base/class_methods.rb +0 -28
- data/sub/avm-git/lib/avm/git/launcher/base/dirty_files.rb +0 -21
- data/sub/avm-git/lib/avm/git/launcher/base/remotes.rb +0 -37
- data/sub/avm-git/lib/avm/git/launcher/base/subrepo.rb +0 -42
- data/sub/avm-git/lib/avm/git/launcher/base/underlying.rb +0 -54
- data/sub/avm-git/lib/avm/git/launcher/base.rb +0 -81
- data/sub/avm-git/lib/avm/git/launcher/error.rb +0 -13
- data/sub/avm-git/lib/avm/git/launcher/mirror_update.rb +0 -36
- data/sub/avm-git/lib/avm/git/launcher/publish_base.rb +0 -128
- data/sub/avm-git/lib/avm/git/launcher/remote.rb +0 -53
- data/sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb +0 -36
- data/sub/avm-git/lib/avm/git/launcher/warp_base.rb +0 -63
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/local_project_mixin.rb +0 -16
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/publish.rb +0 -13
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/warp.rb +0 -25
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git.rb +0 -22
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo/publish.rb +0 -29
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo/warp.rb +0 -82
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo.rb +0 -32
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/provider.rb +0 -16
- data/sub/avm-git/lib/avm/git/launcher_stereotypes.rb +0 -9
- data/sub/avm-git/lib/avm/git/organize/reference_update.rb +0 -32
- data/sub/avm-git/lib/avm/git/organize/repository.rb +0 -74
- data/sub/avm-git/lib/avm/git/organize.rb +0 -9
- data/sub/avm-git/lib/avm/git/revision_test.rb +0 -102
- data/sub/avm-git/lib/avm/git/runners/base/commit.rb +0 -96
- data/sub/avm-git/lib/avm/git/runners/base/deploy.rb +0 -108
- data/sub/avm-git/lib/avm/git/runners/base/dirty_files.rb +0 -42
- data/sub/avm-git/lib/avm/git/runners/base/organize.rb +0 -72
- data/sub/avm-git/lib/avm/git/runners/base/revisions_test.rb +0 -63
- data/sub/avm-git/lib/avm/git/runners/base/subrepo/check.rb +0 -45
- data/sub/avm-git/lib/avm/git/runners/base/subrepo/clone.rb +0 -80
- data/sub/avm-git/lib/avm/git/runners/base/subrepo/fix.rb +0 -69
- data/sub/avm-git/lib/avm/git/runners/base.rb +0 -40
- data/sub/avm-git/lib/avm/git/runners.rb +0 -9
- data/sub/avm-git/lib/avm/git/scms/git/branch.rb +0 -28
- data/sub/avm-git/lib/avm/git/scms/git/branches.rb +0 -17
- data/sub/avm-git/lib/avm/git/scms/git/change_tracker.rb +0 -34
- data/sub/avm-git/lib/avm/git/scms/git/changed_file.rb +0 -25
- data/sub/avm-git/lib/avm/git/scms/git/changed_files.rb +0 -21
- data/sub/avm-git/lib/avm/git/scms/git/commit/deploy.rb +0 -38
- data/sub/avm-git/lib/avm/git/scms/git/commit/deploy_methods.rb +0 -24
- data/sub/avm-git/lib/avm/git/scms/git/commit.rb +0 -64
- data/sub/avm-git/lib/avm/git/scms/git/commit_dirty.rb +0 -32
- data/sub/avm-git/lib/avm/git/scms/git/commits.rb +0 -44
- data/sub/avm-git/lib/avm/git/scms/git/interval.rb +0 -28
- data/sub/avm-git/lib/avm/git/scms/git/milestones.rb +0 -18
- data/sub/avm-git/lib/avm/git/scms/git/remote.rb +0 -18
- data/sub/avm-git/lib/avm/git/scms/git/remotes.rb +0 -29
- data/sub/avm-git/lib/avm/git/scms/git/run_commit.rb +0 -54
- data/sub/avm-git/lib/avm/git/scms/git.rb +0 -46
- data/sub/avm-git/lib/avm/git/scms/git_sub_base/changed_file.rb +0 -19
- data/sub/avm-git/lib/avm/git/scms/git_sub_base/commit.rb +0 -23
- data/sub/avm-git/lib/avm/git/scms/git_sub_base/interval.rb +0 -23
- data/sub/avm-git/lib/avm/git/scms/git_sub_base.rb +0 -30
- data/sub/avm-git/lib/avm/git/scms/git_subrepo.rb +0 -33
- data/sub/avm-git/lib/avm/git/scms/git_subtree.rb +0 -29
- data/sub/avm-git/lib/avm/git/scms/provider.rb +0 -16
- data/sub/avm-git/lib/avm/git/scms.rb +0 -9
- data/sub/avm-git/lib/avm/git/subrepo_check/parent.rb +0 -48
- data/sub/avm-git/lib/avm/git/subrepo_check/remote.rb +0 -86
- data/sub/avm-git/lib/avm/git/subrepo_check/show_result.rb +0 -30
- data/sub/avm-git/lib/avm/git/subrepo_check.rb +0 -36
- data/sub/avm-git/lib/avm/git/subrepo_checks.rb +0 -57
- data/sub/avm-git/lib/avm/git/vendor/github.rb +0 -20
- data/sub/avm-git/lib/avm/git/vendor.rb +0 -9
- data/sub/avm-git/lib/avm/git/version.rb +0 -7
- data/sub/avm-git/lib/avm/git.rb +0 -16
- data/sub/avm-git/locale/en.yml +0 -6
- data/sub/avm-git/locale/pt-BR.yml +0 -6
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec.rb +0 -13
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.source.out +0 -1
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.target.yaml +0 -7
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.source.out +0 -1
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.target.yaml +0 -7
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.source.out +0 -1
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.target.yaml +0 -7
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.source.out +0 -2
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.target.yaml +0 -13
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.source.out +0 -2
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.target.yaml +0 -13
- data/sub/avm-git/spec/lib/avm/git/commit_spec.rb +0 -56
- data/sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb +0 -45
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec.rb +0 -83
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec_files/config.yml +0 -5
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec_settings.yml +0 -6
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec.rb +0 -53
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec_files/config.yml +0 -3
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec_settings.yml +0 -6
- data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec.rb +0 -126
- data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec_files/append1/stub3.txt.template +0 -1
- data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec_files/append2/stub4.txt +0 -1
- data/sub/avm-git/spec/lib/avm/git/scms/git/commit/deploy_spec.rb +0 -92
- data/sub/avm-git/spec/lib/avm/git/scms/git_spec.rb +0 -8
- data/sub/avm-git/spec/lib/avm/git/scms/git_subrepo_spec.rb +0 -8
- data/sub/avm-git/spec/lib/avm/git/vendor/github_spec.rb +0 -23
- /data/sub/{avm-git → avm-tools}/Gemfile +0 -0
- /data/sub/{avm-git → avm-tools}/spec/rubocop_spec.rb +0 -0
- /data/sub/{avm → eac_cli}/Gemfile +0 -0
- /data/sub/{avm → eac_cli}/spec/rubocop_spec.rb +0 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/definition/alternative'
|
4
|
+
require 'eac_cli/parser/alternative'
|
5
|
+
|
6
|
+
RSpec.describe EacCli::Parser::Alternative, '#subcommands' do
|
7
|
+
let(:instance) { described_class.new(alternative, argv) }
|
8
|
+
let(:actual_parsed) { instance.parsed.to_h.symbolize_keys }
|
9
|
+
let(:alternative) do
|
10
|
+
r = EacCli::Definition::Alternative.new
|
11
|
+
r.bool_opt '-b', '--opt1', 'A boolean option'
|
12
|
+
r.arg_opt '-a', '--opt2', 'A argument option'
|
13
|
+
r.subcommands
|
14
|
+
r
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'with all values' do
|
18
|
+
let(:argv) { %w[--opt1 --opt2 OPT2 CMD CMD_ARG_1 --CMD_ARG_2] }
|
19
|
+
let(:parsed_expected) do
|
20
|
+
{
|
21
|
+
opt1: true, opt2: 'OPT2',
|
22
|
+
EacCli::Definition::Alternative::SUBCOMMAND_NAME_ARG => 'CMD',
|
23
|
+
EacCli::Definition::Alternative::SUBCOMMAND_ARGS_ARG => %w[CMD_ARG_1 --CMD_ARG_2]
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
it { expect(instance.error).to be_blank }
|
28
|
+
it { expect(actual_parsed).to eq(parsed_expected) }
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'with only required values' do
|
32
|
+
let(:argv) { %w[CMD] }
|
33
|
+
let(:parsed_expected) do
|
34
|
+
{
|
35
|
+
opt1: false, opt2: nil,
|
36
|
+
EacCli::Definition::Alternative::SUBCOMMAND_NAME_ARG => 'CMD',
|
37
|
+
EacCli::Definition::Alternative::SUBCOMMAND_ARGS_ARG => []
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
it { expect(instance.error).to be_blank }
|
42
|
+
it { expect(actual_parsed).to eq(parsed_expected) }
|
43
|
+
end
|
44
|
+
|
45
|
+
context 'without required values' do
|
46
|
+
let(:argv) { %w[--opt1] }
|
47
|
+
let(:parsed_expected) do
|
48
|
+
{
|
49
|
+
opt1: true, opt2: nil,
|
50
|
+
EacCli::Definition::Alternative::SUBCOMMAND_NAME_ARG => nil,
|
51
|
+
EacCli::Definition::Alternative::SUBCOMMAND_ARGS_ARG => []
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
it { expect(instance.error).to be_present }
|
56
|
+
it { expect(actual_parsed).to eq(parsed_expected) }
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/definition/alternative'
|
4
|
+
require 'eac_cli/parser/alternative'
|
5
|
+
|
6
|
+
RSpec.describe EacCli::Parser::Alternative do
|
7
|
+
let(:instance) { described_class.new(alternative, argv) }
|
8
|
+
let(:actual_parsed) { instance.parsed.to_h.symbolize_keys }
|
9
|
+
|
10
|
+
context 'without subcommands' do
|
11
|
+
let(:alternative) do
|
12
|
+
r = EacCli::Definition::Alternative.new
|
13
|
+
r.bool_opt '-b', '--opt1', 'A boolean option'
|
14
|
+
r.arg_opt '-a', '--opt2', 'A argument option'
|
15
|
+
r.bool_opt '-c', '--opt3', 'A required boolean option', required: true
|
16
|
+
r.pos_arg :pos1
|
17
|
+
r.pos_arg :pos2, optional: true, repeat: true
|
18
|
+
r
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'with all values' do
|
22
|
+
let(:argv) { %w[--opt1 --opt2 OPT2 --opt3 POS1 POS2_1 POS2_2] }
|
23
|
+
let(:parsed_expected) do
|
24
|
+
{
|
25
|
+
opt1: true, opt2: 'OPT2', opt3: true, pos1: 'POS1', pos2: %w[POS2_1 POS2_2]
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
it { expect(instance.error).to be_blank }
|
30
|
+
it { expect(actual_parsed).to eq(parsed_expected) }
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'with only required values' do
|
34
|
+
let(:argv) { %w[--opt3 POS1] }
|
35
|
+
let(:parsed_expected) { { opt1: false, opt2: nil, opt3: true, pos1: 'POS1', pos2: [] } }
|
36
|
+
|
37
|
+
it { expect(instance.error).to be_blank }
|
38
|
+
it { expect(actual_parsed).to eq(parsed_expected) }
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'with double dash' do
|
42
|
+
let(:argv) { %w[--opt3 POS1 -- --opt1 --] }
|
43
|
+
let(:parsed_expected) do
|
44
|
+
{ opt1: false, opt2: nil, opt3: true, pos1: 'POS1', pos2: %w[--opt1 --] }
|
45
|
+
end
|
46
|
+
|
47
|
+
it { expect(instance.error).to be_blank }
|
48
|
+
it { expect(actual_parsed).to eq(parsed_expected) }
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'without required positional' do
|
52
|
+
let(:argv) { %w[--opt1 --opt3] }
|
53
|
+
let(:parsed_expected) { { opt1: true, opt2: nil, opt3: true, pos1: nil, pos2: [] } }
|
54
|
+
|
55
|
+
it { expect(instance.error).to be_present }
|
56
|
+
it { expect(actual_parsed).to eq(parsed_expected) }
|
57
|
+
end
|
58
|
+
|
59
|
+
context 'without required option' do
|
60
|
+
let(:argv) { %w[--opt1 POS1] }
|
61
|
+
let(:parsed_expected) { { opt1: true, opt2: nil, opt3: false, pos1: 'POS1', pos2: [] } }
|
62
|
+
|
63
|
+
it { expect(instance.error).to be_present }
|
64
|
+
it { expect(actual_parsed).to eq(parsed_expected) }
|
65
|
+
end
|
66
|
+
|
67
|
+
context 'without any required option or positional' do
|
68
|
+
let(:argv) { %w[] }
|
69
|
+
let(:parsed_expected) { { opt1: false, opt2: nil, opt3: false, pos1: nil, pos2: [] } }
|
70
|
+
|
71
|
+
it { expect(instance.error).to be_present }
|
72
|
+
it { expect(actual_parsed).to eq(parsed_expected) }
|
73
|
+
end
|
74
|
+
|
75
|
+
context 'with excedent positional' do
|
76
|
+
let(:alternative) do
|
77
|
+
r = EacCli::Definition::Alternative.new
|
78
|
+
r.pos_arg :pos1
|
79
|
+
r
|
80
|
+
end
|
81
|
+
|
82
|
+
let(:argv) { %w[POS1 POS2] }
|
83
|
+
let(:parsed_expected) { { pos1: 'POS1' } }
|
84
|
+
|
85
|
+
it { expect(instance.error).to be_present }
|
86
|
+
it { expect(actual_parsed).to eq(parsed_expected) }
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/runner'
|
4
|
+
|
5
|
+
RSpec.describe EacCli::Runner, '#for_context' do
|
6
|
+
let(:parent_runner_class) do
|
7
|
+
example = self
|
8
|
+
Class.new do
|
9
|
+
include example.described_class
|
10
|
+
|
11
|
+
def self.name
|
12
|
+
'ParentRunnerClass'
|
13
|
+
end
|
14
|
+
|
15
|
+
for_context :method_for_context
|
16
|
+
|
17
|
+
def run; end
|
18
|
+
|
19
|
+
def method_for_context; end
|
20
|
+
|
21
|
+
def method_not_for_context; end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
let(:child_runner_class1) do # rubocop:disable RSpec/IndexedLet
|
26
|
+
example = self
|
27
|
+
Class.new do
|
28
|
+
include example.described_class
|
29
|
+
|
30
|
+
def self.name
|
31
|
+
'ChildRunnerClass1'
|
32
|
+
end
|
33
|
+
|
34
|
+
def run
|
35
|
+
method_for_context
|
36
|
+
runner_context.call(:method_for_context)
|
37
|
+
runner_context.call(:method_not_for_context)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
let(:child_runner_class2) do # rubocop:disable RSpec/IndexedLet
|
43
|
+
example = self
|
44
|
+
Class.new do
|
45
|
+
include example.described_class
|
46
|
+
|
47
|
+
def self.name
|
48
|
+
'ChildRunnerClass2'
|
49
|
+
end
|
50
|
+
|
51
|
+
def run
|
52
|
+
method_not_for_context
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
let(:parent_runner) { parent_runner_class.create }
|
58
|
+
let(:context_args) { [{ argv: [], parent: parent_runner }] }
|
59
|
+
let(:child_runner) { child_runner_class.create(*context_args) }
|
60
|
+
|
61
|
+
it { expect(parent_runner.for_context?(:method_for_context)).to be(true) }
|
62
|
+
it { expect(parent_runner.for_context?(:method_not_for_context)).to be(false) }
|
63
|
+
|
64
|
+
context 'when method is for context' do
|
65
|
+
let(:child_runner_class) { child_runner_class1 }
|
66
|
+
|
67
|
+
it do
|
68
|
+
expect { child_runner.run }.not_to raise_error
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
context 'when method is not for context' do
|
73
|
+
let(:child_runner_class) { child_runner_class2 }
|
74
|
+
|
75
|
+
it do
|
76
|
+
expect { child_runner.run }.to raise_error(NameError)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/runner'
|
4
|
+
|
5
|
+
RSpec.describe EacCli::Runner do
|
6
|
+
let(:runner_class) do
|
7
|
+
the_module = described_class
|
8
|
+
Class.new do
|
9
|
+
include the_module
|
10
|
+
|
11
|
+
runner_definition do
|
12
|
+
arg_opt '-o', '--opt1', 'A arg option.'
|
13
|
+
bool_opt '-p', '--opt2', 'A boolean option'
|
14
|
+
arg_opt '-q', '--opt4', 'A repeatable argument option.', repeat: true
|
15
|
+
bool_opt '-r', '--opt5', 'A repeatable boolean option', repeat: true
|
16
|
+
arg_opt '-s', '--opt6', 'A argument option with default value', default: 'DEFAULT'
|
17
|
+
pos_arg :pos1
|
18
|
+
pos_arg :pos2, repeat: true, optional: true
|
19
|
+
alt do
|
20
|
+
bool_opt '-a', '--opt3', 'A boolean option in a alternative.', required: true
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def run; end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
let(:instance) { runner_class.create(argv) }
|
29
|
+
let(:parsed_actual) { instance.parsed.to_h.symbolize_keys }
|
30
|
+
|
31
|
+
context 'when all args are supplied' do
|
32
|
+
let(:argv) { %w[--opt1 aaa --opt2 bbb ccc ddd --opt6 6] }
|
33
|
+
let(:parsed_expected) do
|
34
|
+
{ opt1: 'aaa', opt2: true, opt3: false, opt4: [], opt5: 0, opt6: '6', pos1: 'bbb',
|
35
|
+
pos2: %w[ccc ddd] }
|
36
|
+
end
|
37
|
+
|
38
|
+
it { expect(parsed_actual).to eq(parsed_expected) }
|
39
|
+
it { expect(instance.parsed.opt1).to eq('aaa') }
|
40
|
+
it { expect(instance.parsed.opt2?).to be(true) }
|
41
|
+
it { expect(instance.parsed.pos1).to eq('bbb') }
|
42
|
+
it { expect(instance.parsed.pos2).to eq(%w[ccc ddd]) }
|
43
|
+
end
|
44
|
+
|
45
|
+
context 'with long option and argument in same position' do
|
46
|
+
let(:argv) { %w[--opt1=aaa pos1] }
|
47
|
+
|
48
|
+
it { expect(instance.parsed.opt1).to eq('aaa') }
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'with valid grouped short options' do
|
52
|
+
let(:argv) { %w[-po aaa pos1] }
|
53
|
+
|
54
|
+
it { expect(instance.parsed.opt1).to eq('aaa') }
|
55
|
+
it { expect(instance.parsed.opt2?).to be(true) }
|
56
|
+
end
|
57
|
+
|
58
|
+
context 'with invalid grouped short options' do
|
59
|
+
let(:argv) { %w[-op aaa pos1] }
|
60
|
+
|
61
|
+
it do
|
62
|
+
expect { instance.parsed }.to raise_error(EacCli::Parser::Error)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
context 'when only required args are supplied' do
|
67
|
+
let(:argv) { %w[bbb] }
|
68
|
+
let(:parsed_expected) do
|
69
|
+
{ opt1: nil, opt2: false, opt3: false, opt4: [], opt5: 0, opt6: 'DEFAULT', pos1: 'bbb',
|
70
|
+
pos2: [] }
|
71
|
+
end
|
72
|
+
|
73
|
+
it { expect(parsed_actual).to eq(parsed_expected) }
|
74
|
+
it { expect(instance.parsed.opt1).to be_nil }
|
75
|
+
it { expect(instance.parsed.opt2?).to be(false) }
|
76
|
+
it { expect(instance.parsed.pos1).to eq('bbb') }
|
77
|
+
it { expect(instance.parsed.pos2).to eq([]) }
|
78
|
+
end
|
79
|
+
|
80
|
+
context 'when required args are not supplied' do
|
81
|
+
let(:argv) { %w[] }
|
82
|
+
|
83
|
+
it do
|
84
|
+
expect { instance.parsed }.to raise_error(EacCli::Parser::Error)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
context 'when alternative args are supplied' do
|
89
|
+
let(:argv) { %w[--opt3] }
|
90
|
+
let(:parsed_expected) do
|
91
|
+
{ opt1: nil, opt2: false, opt3: true, opt4: [], opt5: 0, opt6: 'DEFAULT', pos1: nil,
|
92
|
+
pos2: [] }
|
93
|
+
end
|
94
|
+
|
95
|
+
it { expect(parsed_actual).to eq(parsed_expected) }
|
96
|
+
it { expect(instance.parsed.opt3?).to be(true) }
|
97
|
+
end
|
98
|
+
|
99
|
+
context 'when repeated options are supplied' do
|
100
|
+
let(:argv) { %w[--opt5 -rrr --opt4=A -q B --opt4 C AAA] }
|
101
|
+
let(:parsed_expected) do
|
102
|
+
{ opt1: nil, opt2: false, opt3: false, opt4: %w[A B C], opt5: 4, opt6: 'DEFAULT', pos1: 'AAA',
|
103
|
+
pos2: [] }
|
104
|
+
end
|
105
|
+
|
106
|
+
it { expect(parsed_actual).to eq(parsed_expected) }
|
107
|
+
end
|
108
|
+
|
109
|
+
context 'when extra args are not supplied' do
|
110
|
+
let(:runner_class) do
|
111
|
+
the_module = described_class
|
112
|
+
Class.new do
|
113
|
+
include the_module
|
114
|
+
|
115
|
+
runner_definition do
|
116
|
+
pos_arg :pos1
|
117
|
+
end
|
118
|
+
|
119
|
+
def run; end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
let(:argv) { %w[aaa bbb] }
|
124
|
+
|
125
|
+
it do
|
126
|
+
expect { instance.parsed }.to raise_error(EacCli::Parser::Error)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/runner_with/confirmation/input_result'
|
4
|
+
require 'eac_cli/speaker'
|
5
|
+
require 'eac_ruby_utils'
|
6
|
+
|
7
|
+
RSpec.describe EacCli::RunnerWith::Confirmation::InputResult do
|
8
|
+
let(:speaker) { EacCli::Speaker.new }
|
9
|
+
|
10
|
+
around do |example|
|
11
|
+
EacRubyUtils::Speaker.context.on(speaker) { example.run }
|
12
|
+
end
|
13
|
+
|
14
|
+
before do
|
15
|
+
allow(speaker).to receive(:warn) { |message| raise(message.to_s) }
|
16
|
+
end
|
17
|
+
|
18
|
+
[
|
19
|
+
['n', false, false],
|
20
|
+
['N', false, true],
|
21
|
+
['y', true, false],
|
22
|
+
['Y', true, true]
|
23
|
+
].each do |test_values|
|
24
|
+
user_input, confirm, for_all = test_values
|
25
|
+
context "when user input is \"#{user_input}\"" do
|
26
|
+
let(:instance) { described_class.by_message('A message') }
|
27
|
+
|
28
|
+
before do
|
29
|
+
allow(speaker).to receive(:request_string).and_return(user_input)
|
30
|
+
end
|
31
|
+
|
32
|
+
it { expect(instance.confirm?).to eq(confirm) }
|
33
|
+
it { expect(instance.for_all?).to eq(for_all) }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/runner_with/confirmation'
|
4
|
+
|
5
|
+
RSpec.describe EacCli::RunnerWith::Confirmation do
|
6
|
+
let(:runner) do
|
7
|
+
the_module = described_class
|
8
|
+
Class.new do
|
9
|
+
include the_module
|
10
|
+
|
11
|
+
runner_definition do
|
12
|
+
desc 'A stub runner.'
|
13
|
+
end
|
14
|
+
|
15
|
+
def run
|
16
|
+
if confirm?
|
17
|
+
Kernel.puts 'Accepted'
|
18
|
+
else
|
19
|
+
Kernel.puts 'Denied'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
let(:instance) { runner.create(argv: runner_argv) }
|
26
|
+
|
27
|
+
context 'without --no option' do
|
28
|
+
let(:runner_argv) { %w[--no] }
|
29
|
+
|
30
|
+
it do
|
31
|
+
expect { instance.run }.to output("Denied\n").to_stdout_from_any_process
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'without --yes option' do
|
36
|
+
let(:runner_argv) { %w[--yes] }
|
37
|
+
|
38
|
+
it do
|
39
|
+
expect { instance.run }.to output("Accepted\n").to_stdout_from_any_process
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/runner_with/help/layout'
|
4
|
+
|
5
|
+
RSpec.describe EacCli::RunnerWith::Help::Layout do
|
6
|
+
describe '#list_section' do
|
7
|
+
{
|
8
|
+
['Options', ['Option A', 'Option B']] => <<~TEXT
|
9
|
+
Options:
|
10
|
+
Option A
|
11
|
+
Option B
|
12
|
+
TEXT
|
13
|
+
}.each do |source, expected|
|
14
|
+
context "when source is #{source}" do
|
15
|
+
it do
|
16
|
+
expect(described_class.list_section(*source)).to eq(expected)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/runner_with/help'
|
4
|
+
require 'eac_ruby_utils'
|
5
|
+
|
6
|
+
RSpec.describe EacCli::RunnerWith::Help do
|
7
|
+
let(:runner) do
|
8
|
+
the_module = described_class
|
9
|
+
Class.new do
|
10
|
+
include the_module
|
11
|
+
|
12
|
+
runner_definition do
|
13
|
+
desc 'A stub runner.'
|
14
|
+
pos_arg :a_argument
|
15
|
+
end
|
16
|
+
|
17
|
+
def run
|
18
|
+
puts 'Runner run'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
[
|
24
|
+
['--help'],
|
25
|
+
['trash-pos-arg-before', '--help', 'trash-pos-arg-after', '--any-option', '-XYZ',
|
26
|
+
'other-trash-arg']
|
27
|
+
].each do |runner_argv|
|
28
|
+
context "when runner ARGV is #{runner_argv}" do
|
29
|
+
let(:instance) { runner.create(argv: runner_argv) }
|
30
|
+
let(:expected_output_source) do
|
31
|
+
<<~OUTPUT
|
32
|
+
A stub runner.
|
33
|
+
|
34
|
+
Usage:
|
35
|
+
__PROGRAM__ [options] <a_argument>
|
36
|
+
__PROGRAM__ --help
|
37
|
+
|
38
|
+
Options:
|
39
|
+
-h --help Show help.
|
40
|
+
OUTPUT
|
41
|
+
end
|
42
|
+
let(:expected_output) do
|
43
|
+
expected_output_source.gsub('__PROGRAM__', instance.program_name)
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'show help text' do
|
47
|
+
expect { instance.run_run }.to output(expected_output).to_stdout_from_any_process
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/runner_with/output_list'
|
4
|
+
|
5
|
+
RSpec.describe EacCli::RunnerWith::OutputList do
|
6
|
+
let(:runner) do
|
7
|
+
the_module = described_class
|
8
|
+
Class.new do
|
9
|
+
include the_module
|
10
|
+
|
11
|
+
def run
|
12
|
+
run_output
|
13
|
+
end
|
14
|
+
|
15
|
+
def list_columns
|
16
|
+
%w[id name]
|
17
|
+
end
|
18
|
+
|
19
|
+
def list_rows
|
20
|
+
[[1, 'João'], [2, 'Maria']].map { |v| Struct.new(:id, :name).new(*v) }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
let(:instance) { runner.create(argv: runner_argv) }
|
26
|
+
|
27
|
+
{
|
28
|
+
'csv' => <<~OUTPUT,
|
29
|
+
id,name
|
30
|
+
1,João
|
31
|
+
2,Maria
|
32
|
+
OUTPUT
|
33
|
+
'tty' => <<~OUTPUT,
|
34
|
+
┌──┬─────┐
|
35
|
+
│id│name │
|
36
|
+
│1 │João │
|
37
|
+
├──┼─────┤
|
38
|
+
│2 │Maria│
|
39
|
+
└──┴─────┘
|
40
|
+
OUTPUT
|
41
|
+
'yaml' => <<~OUTPUT
|
42
|
+
---
|
43
|
+
- id: '1'
|
44
|
+
name: João
|
45
|
+
- id: '2'
|
46
|
+
name: Maria
|
47
|
+
OUTPUT
|
48
|
+
}.each do |format, expected_output|
|
49
|
+
context "with --format=#{format}" do
|
50
|
+
let(:runner_argv) { ['--format', format] }
|
51
|
+
|
52
|
+
it do
|
53
|
+
expect { instance.run }.to output(expected_output).to_stdout_from_any_process
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/runner_with/output'
|
4
|
+
require 'eac_ruby_utils'
|
5
|
+
|
6
|
+
RSpec.describe EacCli::RunnerWith::Output do
|
7
|
+
let(:runner) do
|
8
|
+
the_module = described_class
|
9
|
+
Class.new do
|
10
|
+
include the_module
|
11
|
+
|
12
|
+
attr_accessor :temp_dir
|
13
|
+
|
14
|
+
runner_definition do
|
15
|
+
desc 'A stub root runner.'
|
16
|
+
pos_arg :input_text
|
17
|
+
end
|
18
|
+
|
19
|
+
def run
|
20
|
+
run_output
|
21
|
+
end
|
22
|
+
|
23
|
+
def output_content
|
24
|
+
parsed.input_text
|
25
|
+
end
|
26
|
+
|
27
|
+
def default_file_to_output
|
28
|
+
temp_dir.join('default_file')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
let(:stub_text) { 'STUB_TEXT' }
|
34
|
+
let(:instance) do
|
35
|
+
r = runner.create(argv: runner_argv)
|
36
|
+
r.temp_dir = temp_dir
|
37
|
+
r
|
38
|
+
end
|
39
|
+
let(:temp_dir) { EacRubyUtils::Fs::Temp.directory }
|
40
|
+
|
41
|
+
after { temp_dir.remove }
|
42
|
+
|
43
|
+
context 'without --output option' do
|
44
|
+
let(:runner_argv) { [stub_text] }
|
45
|
+
|
46
|
+
it do
|
47
|
+
expect { instance.run }.to output(stub_text).to_stdout_from_any_process
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'without --output option as to stdout' do
|
52
|
+
let(:runner_argv) { ['--output', EacCli::RunnerWith::Output::STDOUT_OPTION, stub_text] }
|
53
|
+
|
54
|
+
it do
|
55
|
+
expect { instance.run }.to output(stub_text).to_stdout_from_any_process
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context 'without --output option as to default file' do
|
60
|
+
let(:output_file) { temp_dir.join('default_file') }
|
61
|
+
let(:runner_argv) do
|
62
|
+
['--output', EacCli::RunnerWith::Output::DEFAULT_FILE_OPTION,
|
63
|
+
stub_text]
|
64
|
+
end
|
65
|
+
|
66
|
+
before { instance.run }
|
67
|
+
|
68
|
+
it { expect(output_file).to exist }
|
69
|
+
it { expect(output_file.read).to eq(stub_text) }
|
70
|
+
end
|
71
|
+
|
72
|
+
context 'with --output option' do
|
73
|
+
let(:output_file) { temp_dir.join('a output file') }
|
74
|
+
let(:runner_argv) { ['--output', output_file.to_path, stub_text] }
|
75
|
+
|
76
|
+
before { instance.run }
|
77
|
+
|
78
|
+
it { expect(output_file).to exist }
|
79
|
+
it { expect(output_file.read).to eq(stub_text) }
|
80
|
+
end
|
81
|
+
end
|