eac_tools 0.102.1 → 0.103.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 +46 -43
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +26 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/apache_host.rb +10 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/database.rb +27 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/files.rb +18 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb +52 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/install.rb +43 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/nodejs.rb +19 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/web.rb +17 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +53 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/deploy.rb +16 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +110 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/entity_base.rb +31 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/project.rb +21 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/root.rb +17 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/wiki_page.rb +50 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api.rb +10 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/docker.rb +15 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page/read.rb +25 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page/write.rb +68 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page.rb +26 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project.rb +22 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project_rename.rb +53 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb +32 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/core_update.rb +125 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/core_update.rb +61 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/docker.rb +16 -0
- data/sub/{avm-git/lib/avm/git → avm-eac_redmine_base0/lib/avm/eac_redmine_base0}/version.rb +2 -2
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0.rb +16 -0
- data/sub/avm-eac_redmine_base0/locale/en.yml +6 -0
- data/sub/avm-eac_redmine_base0/locale/pt-BR.yml +6 -0
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/apache_host_spec.rb +22 -0
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/apache_host_spec_files/apache_host_spec_no_ssl_content.conf +11 -0
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/base/gitolite_spec.rb +26 -0
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/base/gitolite_spec_files/config.yml +10 -0
- data/sub/{avm-git → avm-eac_redmine_base0}/spec/spec_helper.rb +3 -2
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/deploy/config/install.sh.template +45 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/deploy/config/secrets.yml +8 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile.template +37 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_host_dockerfile +8 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_http_virtualhost.conf.template +10 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_https_virtualhost.conf.template +16 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_path_dockerfile +5 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/start.sh.template +52 -0
- data/sub/eac_cli/Gemfile +8 -0
- 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 +4 -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 +42 -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/rspec.rb +7 -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/{avm-git/lib/avm/git/launcher_stereotypes.rb → eac_cli/lib/eac_cli/runner/context_responders.rb} +3 -3
- 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/eac_cli/lib/eac_cli/runner_with.rb +7 -0
- data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +54 -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/eac_cli/lib/eac_cli/version.rb +5 -0
- 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/rubocop_spec.rb +3 -0
- data/sub/eac_cli/spec/spec_helper.rb +4 -0
- metadata +157 -130
- 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 -127
- 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/git_subtree/publish.rb +0 -12
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subtree/warp.rb +0 -29
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subtree.rb +0 -47
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/provider.rb +0 -17
- 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/subrepo.rb +0 -17
- 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 -37
- 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.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-eac_redmine_base0}/Gemfile +0 -0
- /data/sub/{avm-git → avm-eac_redmine_base0}/spec/rubocop_spec.rb +0 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils'
|
4
|
+
EacRubyUtils::RootModuleSetup.perform __FILE__ do
|
5
|
+
ignore 'core_ext'
|
6
|
+
ignore 'patches'
|
7
|
+
end
|
8
|
+
|
9
|
+
module EacCli
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'eac_config'
|
13
|
+
require 'colorize'
|
14
|
+
require 'eac_cli/core_ext'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/definition/alternative'
|
4
|
+
|
5
|
+
RSpec.describe EacCli::Definition::Alternative do
|
6
|
+
let(:instance) { described_class.new }
|
7
|
+
|
8
|
+
it { expect { instance.arg_opt '-a', '--opt2', 'A argument option' }.not_to raise_error }
|
9
|
+
it { expect { instance.bool_opt '-b', '--opt1', 'A boolean option' }.not_to raise_error }
|
10
|
+
it { expect { instance.bool_opt '-b', '--no-description' }.not_to raise_error }
|
11
|
+
it { expect { instance.bool_opt '--opt1', 'A option without short' }.not_to raise_error }
|
12
|
+
it { expect { instance.bool_opt '-b', 'A option without long' }.not_to raise_error }
|
13
|
+
it { expect { instance.bool_opt 'A option without selectors' }.to raise_error(StandardError) }
|
14
|
+
it { expect { instance.options_argument(true) }.not_to raise_error }
|
15
|
+
it { expect { instance.pos_arg :pos1 }.not_to raise_error }
|
16
|
+
it { expect { instance.pos_arg :pos2, optional: true, repeat: true }.not_to raise_error }
|
17
|
+
it { expect { instance.subcommands }.not_to raise_error }
|
18
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/old_configs'
|
4
|
+
|
5
|
+
RSpec.describe EacCli::OldConfigs do
|
6
|
+
describe '#entry_key_to_envvar_name' do
|
7
|
+
{
|
8
|
+
'a.entry.value' => 'A_ENTRY_VALUE',
|
9
|
+
'appli-cation_0.var_one' => 'APPLICATION_0_VAR_ONE'
|
10
|
+
}.each do |input, expected_result|
|
11
|
+
it { expect(described_class.entry_key_to_envvar_name(input)).to eq(expected_result) }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -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
|