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,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacCli
|
4
|
+
module Runner
|
5
|
+
require_sub __FILE__
|
6
|
+
extend ::ActiveSupport::Concern
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def alias_runner_class_methods(klass, from_suffix, to_suffix)
|
10
|
+
%i[create run].each do |method|
|
11
|
+
alias_class_method(klass, build_method_name(method, from_suffix),
|
12
|
+
build_method_name(method, to_suffix))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def runner?(object)
|
17
|
+
object.is_a?(::Class) && object.included_modules.include?(::EacCli::Runner)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def alias_class_method(klass, from, to)
|
23
|
+
sklass = klass.singleton_class
|
24
|
+
return unless sklass.method_defined?(from)
|
25
|
+
|
26
|
+
sklass.send(:alias_method, to, from)
|
27
|
+
end
|
28
|
+
|
29
|
+
def build_method_name(name, suffix)
|
30
|
+
ss = suffix.if_present('') { |s| "#{s}_" }
|
31
|
+
"#{ss}#{name}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
the_module = self
|
36
|
+
included do
|
37
|
+
the_module.alias_runner_class_methods(self, '', 'original')
|
38
|
+
|
39
|
+
extend AfterClassMethods
|
40
|
+
include InstanceMethods
|
41
|
+
include ::EacCli::Runner::ForContext
|
42
|
+
include ActiveSupport::Callbacks
|
43
|
+
|
44
|
+
define_callbacks :run
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacCli
|
4
|
+
module RunnerWith
|
5
|
+
module Confirmation
|
6
|
+
class InputResult
|
7
|
+
INPUT_NO_FOR_ONE = 'n'
|
8
|
+
INPUT_NO_FOR_ALL = 'N'
|
9
|
+
INPUT_YES_FOR_ONE = 'y'
|
10
|
+
INPUT_YES_FOR_ALL = 'Y'
|
11
|
+
INPUT_FOR_ONE = [INPUT_NO_FOR_ONE, INPUT_YES_FOR_ONE].freeze
|
12
|
+
INPUT_FOR_ALL = [INPUT_NO_FOR_ALL, INPUT_YES_FOR_ALL].freeze
|
13
|
+
INPUT_NO = [INPUT_NO_FOR_ONE, INPUT_NO_FOR_ALL].freeze
|
14
|
+
INPUT_YES = [INPUT_YES_FOR_ONE, INPUT_YES_FOR_ALL].freeze
|
15
|
+
INPUT_LIST = [INPUT_NO_FOR_ALL, INPUT_NO_FOR_ONE, INPUT_YES_FOR_ONE, INPUT_YES_FOR_ALL]
|
16
|
+
.freeze
|
17
|
+
|
18
|
+
class << self
|
19
|
+
enable_speaker
|
20
|
+
|
21
|
+
# @param message [String]
|
22
|
+
# @return [EacCli::RunnerWith::Confirmation::InputResult]
|
23
|
+
def by_message(message)
|
24
|
+
new(input_value_by_speaker(message))
|
25
|
+
end
|
26
|
+
|
27
|
+
# @param message [String]
|
28
|
+
# @return [String]
|
29
|
+
def input_value_by_speaker(message)
|
30
|
+
input(message, list: INPUT_LIST, ignore_case: false)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
common_constructor :input_value
|
35
|
+
|
36
|
+
# @return [Boolean]
|
37
|
+
def confirm?
|
38
|
+
input_value_to_bool(INPUT_NO, INPUT_YES)
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [Boolean]
|
42
|
+
def for_all?
|
43
|
+
input_value_to_bool(INPUT_FOR_ONE, INPUT_FOR_ALL)
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
# @param false_list [Array<String>]
|
49
|
+
# @param true_list [Array<String>]
|
50
|
+
# @return [Boolean]
|
51
|
+
def input_value_to_bool(false_list, true_list)
|
52
|
+
return false if false_list.include?(input_value)
|
53
|
+
return true if true_list.include?(input_value)
|
54
|
+
|
55
|
+
ibr input_value
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacCli
|
4
|
+
module RunnerWith
|
5
|
+
module Confirmation
|
6
|
+
DEFAULT_CONFIRM_QUESTION_TEXT = 'Confirm?'
|
7
|
+
|
8
|
+
common_concern do
|
9
|
+
include ::EacCli::Runner
|
10
|
+
|
11
|
+
enable_settings_provider
|
12
|
+
enable_simple_cache
|
13
|
+
runner_definition do
|
14
|
+
bool_opt '--no', 'Deny confirmation without question.'
|
15
|
+
bool_opt '--yes', 'Accept confirmation without question.'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# @param message [String, nil]
|
20
|
+
# @return [Boolean]
|
21
|
+
def confirm?(message = nil)
|
22
|
+
return for_all_answers.fetch(message) if for_all_answers.key?(message)
|
23
|
+
return false if parsed.no?
|
24
|
+
return true if parsed.yes?
|
25
|
+
|
26
|
+
confirm_input_and_register(message)
|
27
|
+
rescue ::EacCli::Speaker::InputRequested => e
|
28
|
+
fatal_error e.message
|
29
|
+
end
|
30
|
+
|
31
|
+
def run_confirm(message = nil)
|
32
|
+
yield if confirm?(message)
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def cached_confirm_uncached?(message = nil)
|
38
|
+
confirm?(message)
|
39
|
+
end
|
40
|
+
|
41
|
+
# @param message [String, nil]
|
42
|
+
# @return [Boolean]
|
43
|
+
def confirm_input(message)
|
44
|
+
::EacCli::RunnerWith::Confirmation::InputResult.by_message(
|
45
|
+
message || setting_value(:confirm_question_text, default: DEFAULT_CONFIRM_QUESTION_TEXT)
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
# @param message [String, nil]
|
50
|
+
# @return [Boolean]
|
51
|
+
def confirm_input_and_register(message) # rubocop:disable Naming/PredicateMethod
|
52
|
+
r = confirm_input(message)
|
53
|
+
for_all_answers[message] = r.confirm? if r.for_all?
|
54
|
+
r.confirm?
|
55
|
+
end
|
56
|
+
|
57
|
+
# @return [Hash<String, Boolean>]
|
58
|
+
def for_all_answers_uncached
|
59
|
+
{}
|
60
|
+
end
|
61
|
+
|
62
|
+
require_sub __FILE__
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacCli
|
4
|
+
module RunnerWith
|
5
|
+
module Help
|
6
|
+
class Builder
|
7
|
+
class Alternative
|
8
|
+
enable_method_class
|
9
|
+
|
10
|
+
SUBCOMMANDS_MACRO = '__SUBCOMMANDS__'
|
11
|
+
|
12
|
+
common_constructor :builder, :alternative
|
13
|
+
|
14
|
+
def result
|
15
|
+
(
|
16
|
+
program_name +
|
17
|
+
alternative.options_argument?.if_present([]) { |_v| ['[options]'] } +
|
18
|
+
options +
|
19
|
+
positionals
|
20
|
+
).join(builder.word_separator)
|
21
|
+
end
|
22
|
+
|
23
|
+
def options
|
24
|
+
alternative.options.select(&:show_on_usage?).map do |option|
|
25
|
+
::EacCli::RunnerWith::Help::Builder.option_long(option)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def option_argument(option)
|
30
|
+
b = option.long
|
31
|
+
b += '=<value>' if option.argument?
|
32
|
+
b
|
33
|
+
end
|
34
|
+
|
35
|
+
def positionals
|
36
|
+
alternative.positional.map { |p| positional(p) }.compact_blank
|
37
|
+
end
|
38
|
+
|
39
|
+
def positional(positional)
|
40
|
+
return unless positional.visible?
|
41
|
+
|
42
|
+
if positional.subcommand?
|
43
|
+
SUBCOMMANDS_MACRO
|
44
|
+
else
|
45
|
+
r = "<#{positional.name}>"
|
46
|
+
r += '...' if positional.repeat?
|
47
|
+
r = "[#{r}]" if positional.optional?
|
48
|
+
r
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def program_name
|
53
|
+
r = builder.runner.program_name
|
54
|
+
r = [r] unless r.is_a?(::Enumerable)
|
55
|
+
r
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacCli
|
4
|
+
module RunnerWith
|
5
|
+
module Help
|
6
|
+
class Builder
|
7
|
+
include ::EacCli::RunnerWith::Help::Layout
|
8
|
+
|
9
|
+
require_sub __FILE__, require_mode: :kernel
|
10
|
+
common_constructor :runner
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def option_long(option)
|
14
|
+
b = option.long
|
15
|
+
b += '=<value>' if option.argument?
|
16
|
+
b
|
17
|
+
end
|
18
|
+
|
19
|
+
def option_short(option)
|
20
|
+
b = option.short
|
21
|
+
b += '=<value>' if option.argument?
|
22
|
+
b
|
23
|
+
end
|
24
|
+
|
25
|
+
def option_usage_full(option)
|
26
|
+
if option.long.present?
|
27
|
+
[option.short, option_long(option)].compact_blank.join(word_separator)
|
28
|
+
else
|
29
|
+
option_short(option)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def word_separator
|
34
|
+
WORD_SEPARATOR
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
delegate :word_separator, to: :class
|
39
|
+
|
40
|
+
def definition
|
41
|
+
runner.class.runner_definition
|
42
|
+
end
|
43
|
+
|
44
|
+
# @return [Enumerable<String>]
|
45
|
+
def extra_sections
|
46
|
+
runner.if_respond(:help_extra_text, []) do |v|
|
47
|
+
[v.to_s]
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def option_definition(option)
|
52
|
+
[self.class.option_usage_full(option), option.description,
|
53
|
+
option.default_value? ? "[Default: \"#{option.default_value}\"]" : nil]
|
54
|
+
.compact_blank.join(OPTION_DESCRIPTION_SEPARATOR)
|
55
|
+
end
|
56
|
+
|
57
|
+
# @return [String]
|
58
|
+
def options_section
|
59
|
+
list_section(
|
60
|
+
'Options',
|
61
|
+
definition.alternatives.flat_map(&:options).map { |option| option_definition(option) }
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
# @return [String]
|
66
|
+
def usage_section
|
67
|
+
list_section(
|
68
|
+
'Usage',
|
69
|
+
definition.alternatives.map { |alternative| self.alternative(alternative) }
|
70
|
+
)
|
71
|
+
end
|
72
|
+
|
73
|
+
def to_s
|
74
|
+
join_sections(definition.description, usage_section, options_section, *extra_sections)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacCli
|
4
|
+
module RunnerWith
|
5
|
+
module Help
|
6
|
+
module Layout
|
7
|
+
common_concern do
|
8
|
+
include InstanceClassMethods
|
9
|
+
extend InstanceClassMethods
|
10
|
+
end
|
11
|
+
|
12
|
+
module InstanceClassMethods
|
13
|
+
WORD_SEPARATOR = ' '
|
14
|
+
IDENTATION = WORD_SEPARATOR * 2
|
15
|
+
OPTION_DESCRIPTION_SEPARATOR = IDENTATION * 2
|
16
|
+
LINE_BREAK = "\n"
|
17
|
+
SECTION_SEPARATOR = LINE_BREAK * 2
|
18
|
+
|
19
|
+
# @param title String
|
20
|
+
# @param items [Enumerable<String>]
|
21
|
+
# @return [String]
|
22
|
+
def list_section(title, items)
|
23
|
+
(["#{title}:"] + items.map { |line| "#{IDENTATION}#{line}" })
|
24
|
+
.map { |line| "#{line}\n" }.join
|
25
|
+
end
|
26
|
+
|
27
|
+
# @param sections [Enumerable<String>]
|
28
|
+
# @return [String]
|
29
|
+
def join_sections(*sections)
|
30
|
+
sections.map { |s| s.to_s.strip }.join(SECTION_SEPARATOR) + LINE_BREAK
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
extend InstanceClassMethods
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacCli
|
4
|
+
module RunnerWith
|
5
|
+
module Help
|
6
|
+
require_sub __FILE__, require_mode: :kernel
|
7
|
+
common_concern do
|
8
|
+
include ::EacCli::Runner
|
9
|
+
include ::EacCli::RunnerWith::Help::Layout
|
10
|
+
|
11
|
+
runner_definition.alt do
|
12
|
+
bool_opt '-h', '--help', 'Show help.', usage: true, required: true
|
13
|
+
any_opt
|
14
|
+
pos_arg :any_arg_with_help, repeat: true, optional: true, visible: false
|
15
|
+
end
|
16
|
+
|
17
|
+
set_callback :run, :before do
|
18
|
+
help_run
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# @param items [Enumerable<String>]
|
23
|
+
# @return [String]
|
24
|
+
def help_list_section(title, items)
|
25
|
+
::EacCli::RunnerWith::Help::Layout.list_section(title, items)
|
26
|
+
end
|
27
|
+
|
28
|
+
# @param items [Enumerable<String>]
|
29
|
+
# @return [String]
|
30
|
+
def help_join_sections(*sections)
|
31
|
+
::EacCli::RunnerWith::Help::Layout.join_sections(*sections)
|
32
|
+
end
|
33
|
+
|
34
|
+
def help_run
|
35
|
+
return unless show_help?
|
36
|
+
|
37
|
+
puts help_text
|
38
|
+
raise ::EacCli::Runner::Exit
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [String]
|
42
|
+
def help_text
|
43
|
+
::EacCli::RunnerWith::Help::Builder.new(self).to_s
|
44
|
+
end
|
45
|
+
|
46
|
+
def show_help?
|
47
|
+
parsed.help? && !if_respond(:run_subcommand?, false)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacCli
|
4
|
+
module RunnerWith
|
5
|
+
module Input
|
6
|
+
STDIN_OPTION = '-'
|
7
|
+
BLANK_OPTION = '+'
|
8
|
+
DEFAULT_DEFAULT_INPUT_OPTION = BLANK_OPTION
|
9
|
+
|
10
|
+
common_concern do
|
11
|
+
enable_settings_provider
|
12
|
+
include ::EacCli::Runner
|
13
|
+
|
14
|
+
runner_definition do
|
15
|
+
arg_opt '-i', '--input', 'Input from file.'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def input_content
|
20
|
+
case input_option
|
21
|
+
when STDIN_OPTION then $stdin.read
|
22
|
+
when BLANK_OPTION then ''
|
23
|
+
else input_option.to_pathname.read
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def input_option
|
28
|
+
parsed.input || setting_value(:default_input_option, default: DEFAULT_DEFAULT_INPUT_OPTION)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacCli
|
4
|
+
module RunnerWith
|
5
|
+
module Output
|
6
|
+
STDOUT_OPTION = '-'
|
7
|
+
DEFAULT_FILE_OPTION = '+'
|
8
|
+
DEFAULT_DEFAULT_OUTPUT_OPTION = STDOUT_OPTION
|
9
|
+
DEFAULT_DEFAULT_FILE_TO_OUTPUT = 'output'
|
10
|
+
|
11
|
+
common_concern do
|
12
|
+
enable_abstract_methods
|
13
|
+
enable_settings_provider
|
14
|
+
include ::EacCli::Runner
|
15
|
+
|
16
|
+
abstract_methods :output_content
|
17
|
+
|
18
|
+
runner_definition do
|
19
|
+
arg_opt '-o', '--output', 'Output to file.'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def run_output
|
24
|
+
file = file_to_output
|
25
|
+
if file
|
26
|
+
file.to_pathname.write(output_content)
|
27
|
+
else
|
28
|
+
$stdout.write(output_content)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def output_option
|
33
|
+
parsed.output || default_output_option_value
|
34
|
+
end
|
35
|
+
|
36
|
+
def file_to_output
|
37
|
+
case output_option
|
38
|
+
when STDOUT_OPTION then nil
|
39
|
+
when DEFAULT_FILE_OPTION then default_file_to_output_value
|
40
|
+
else output_option
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def default_output_option_value
|
45
|
+
setting_value(:default_output_option,
|
46
|
+
default: DEFAULT_DEFAULT_OUTPUT_OPTION)
|
47
|
+
end
|
48
|
+
|
49
|
+
def default_file_to_output_value
|
50
|
+
setting_value(:default_file_to_output, default: DEFAULT_DEFAULT_FILE_TO_OUTPUT)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
module EacCli
|
6
|
+
module RunnerWith
|
7
|
+
module OutputItem
|
8
|
+
class AsciidocFormatter < ::EacCli::RunnerWith::OutputItem::BaseFormatter
|
9
|
+
STARTING_LEVEL = 2
|
10
|
+
|
11
|
+
# @return [String]
|
12
|
+
def to_output
|
13
|
+
output_hash(item_hash, STARTING_LEVEL)
|
14
|
+
end
|
15
|
+
|
16
|
+
protected
|
17
|
+
|
18
|
+
# @param hash [Hash]
|
19
|
+
# @param level [Integer]
|
20
|
+
# @return [String]
|
21
|
+
def output_enumerable(enumerable, level)
|
22
|
+
enumerable.map { |e| output_object(e, level + 1) }.join
|
23
|
+
end
|
24
|
+
|
25
|
+
# @param hash [Hash]
|
26
|
+
# @param level [Integer]
|
27
|
+
# @return [String]
|
28
|
+
def output_hash(hash, level)
|
29
|
+
hash.map { |k, v| section(k, v, level) }.join("\n")
|
30
|
+
end
|
31
|
+
|
32
|
+
def output_object(object, level)
|
33
|
+
return output_hash(object, level) if object.is_a?(::Hash)
|
34
|
+
return output_enumerable(object, level) if object.is_a?(::Enumerable)
|
35
|
+
|
36
|
+
output_string(object, level)
|
37
|
+
end
|
38
|
+
|
39
|
+
# @param string [String]
|
40
|
+
# @param level [Integer]
|
41
|
+
# @return [String]
|
42
|
+
def output_string(string, _level)
|
43
|
+
"* #{string.to_s.strip}\n"
|
44
|
+
end
|
45
|
+
|
46
|
+
# @param title [String]
|
47
|
+
# @param content [String]
|
48
|
+
# @param level [Integer]
|
49
|
+
# @return [String]
|
50
|
+
def section(title, content, level)
|
51
|
+
"#{section_title(title, level)}\n\n#{section_content(content, level)}"
|
52
|
+
end
|
53
|
+
|
54
|
+
# @param title [String]
|
55
|
+
# @param level [Integer]
|
56
|
+
# @return [String]
|
57
|
+
def section_title(title, level)
|
58
|
+
"#{'=' * level} #{title}"
|
59
|
+
end
|
60
|
+
|
61
|
+
# @param content [String]
|
62
|
+
# @param level [Integer]
|
63
|
+
# @return [String]
|
64
|
+
def section_content(content, level)
|
65
|
+
output_object(content, level)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'csv'
|
4
|
+
|
5
|
+
module EacCli
|
6
|
+
module RunnerWith
|
7
|
+
module OutputItem
|
8
|
+
class CsvFormatter < ::EacCli::RunnerWith::OutputItem::BaseFormatter
|
9
|
+
COLUMNS = %w[key value].freeze
|
10
|
+
|
11
|
+
# @return [String]
|
12
|
+
def to_output
|
13
|
+
::CSV.generate do |csv|
|
14
|
+
csv << COLUMNS
|
15
|
+
item_hash.each { |k, v| csv << [k, v] }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
module EacCli
|
6
|
+
module RunnerWith
|
7
|
+
module OutputItem
|
8
|
+
class YamlFormatter < ::EacCli::RunnerWith::OutputItem::BaseFormatter
|
9
|
+
# @return [String]
|
10
|
+
def to_output
|
11
|
+
::YAML.dump(item_hash.deep_stringify_keys)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacCli
|
4
|
+
module RunnerWith
|
5
|
+
module OutputItem
|
6
|
+
require_sub __FILE__
|
7
|
+
|
8
|
+
FORMATS = %w[asciidoc csv yaml].freeze
|
9
|
+
|
10
|
+
common_concern do
|
11
|
+
acts_as_abstract :item_hash
|
12
|
+
include ::EacCli::RunnerWith::Output
|
13
|
+
|
14
|
+
runner_definition do
|
15
|
+
arg_opt '-f', '--format', 'Format to output item.', default: 'yaml'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [String]
|
20
|
+
def output_content
|
21
|
+
formatter.to_output
|
22
|
+
end
|
23
|
+
|
24
|
+
# @return [EacCli::RunnerWith::OutputList::BaseFormatter]
|
25
|
+
def formatter
|
26
|
+
formatter_class.new(item_hash)
|
27
|
+
end
|
28
|
+
|
29
|
+
# @return [Class]
|
30
|
+
def formatter_class
|
31
|
+
formats.fetch(parsed.format)
|
32
|
+
end
|
33
|
+
|
34
|
+
# @return [Hash<String, Class>]
|
35
|
+
def formats
|
36
|
+
FORMATS.to_h do |e|
|
37
|
+
[e, ::EacCli::RunnerWith::OutputItem.const_get("#{e.camelize}Formatter")]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [Hash<String, Enumerable<String>]
|
42
|
+
def help_extra_text
|
43
|
+
help_list_section('Formats', formats.keys.sort)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|