eac_tools 0.117.5 → 0.118.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +34 -39
- data/lib/eac_tools/version.rb +1 -1
- data/sub/eac_ruby_base0/.gitrepo +7 -0
- data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +22 -0
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +79 -0
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +32 -0
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/error_presenter.rb +53 -0
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +28 -0
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +7 -0
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec/setup.rb +12 -0
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner/contexts.rb +47 -0
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner/prepend.rb +33 -0
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +30 -0
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +5 -0
- data/sub/{eac_cli/lib/eac_cli.rb → eac_ruby_base0/lib/eac_ruby_base0.rb} +3 -1
- data/sub/{eac_cli → eac_ruby_base0}/spec/spec_helper.rb +1 -1
- metadata +20 -392
- data/sub/eac_cli/.gitrepo +0 -7
- data/sub/eac_cli/eac_cli.gemspec +0 -25
- data/sub/eac_cli/lib/eac_cli/config/entry/options.rb +0 -55
- data/sub/eac_cli/lib/eac_cli/config/entry/undefined.rb +0 -26
- data/sub/eac_cli/lib/eac_cli/config/entry.rb +0 -55
- data/sub/eac_cli/lib/eac_cli/config.rb +0 -13
- data/sub/eac_cli/lib/eac_cli/default_runner.rb +0 -12
- data/sub/eac_cli/lib/eac_cli/definition/alternative.rb +0 -101
- data/sub/eac_cli/lib/eac_cli/definition/argument_option.rb +0 -19
- data/sub/eac_cli/lib/eac_cli/definition/boolean_option.rb +0 -25
- data/sub/eac_cli/lib/eac_cli/definition/error.rb +0 -8
- data/sub/eac_cli/lib/eac_cli/definition/option/initialize_args_parser.rb +0 -48
- data/sub/eac_cli/lib/eac_cli/definition/option.rb +0 -68
- data/sub/eac_cli/lib/eac_cli/definition/option_or_positional.rb +0 -41
- data/sub/eac_cli/lib/eac_cli/definition/positional.rb +0 -50
- data/sub/eac_cli/lib/eac_cli/definition.rb +0 -102
- data/sub/eac_cli/lib/eac_cli/enum.rb +0 -44
- data/sub/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +0 -76
- data/sub/eac_cli/lib/eac_cli/old_configs/password_entry_reader.rb +0 -14
- data/sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +0 -42
- data/sub/eac_cli/lib/eac_cli/old_configs/store_passwords_entry_reader.rb +0 -23
- data/sub/eac_cli/lib/eac_cli/old_configs.rb +0 -30
- data/sub/eac_cli/lib/eac_cli/parser/alternative/any_options.rb +0 -17
- data/sub/eac_cli/lib/eac_cli/parser/alternative/argv.rb +0 -19
- data/sub/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb +0 -24
- data/sub/eac_cli/lib/eac_cli/parser/alternative/long_options.rb +0 -37
- data/sub/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb +0 -29
- data/sub/eac_cli/lib/eac_cli/parser/alternative/options.rb +0 -29
- data/sub/eac_cli/lib/eac_cli/parser/alternative/positionals.rb +0 -30
- data/sub/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +0 -54
- data/sub/eac_cli/lib/eac_cli/parser/alternative.rb +0 -99
- data/sub/eac_cli/lib/eac_cli/parser/collector.rb +0 -52
- data/sub/eac_cli/lib/eac_cli/parser/error.rb +0 -13
- data/sub/eac_cli/lib/eac_cli/parser.rb +0 -31
- data/sub/eac_cli/lib/eac_cli/patches/object/runner_with.rb +0 -23
- data/sub/eac_cli/lib/eac_cli/rspec/setup.rb +0 -41
- data/sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb +0 -34
- data/sub/eac_cli/lib/eac_cli/runner/class_runner.rb +0 -32
- data/sub/eac_cli/lib/eac_cli/runner/context.rb +0 -57
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/base.rb +0 -22
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/parent.rb +0 -24
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/runner.rb +0 -17
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/runner_missing_method.rb +0 -29
- data/sub/eac_cli/lib/eac_cli/runner/context_responders/set.rb +0 -41
- data/sub/eac_cli/lib/eac_cli/runner/exit.rb +0 -14
- data/sub/eac_cli/lib/eac_cli/runner/for_context.rb +0 -35
- data/sub/eac_cli/lib/eac_cli/runner/instance_methods.rb +0 -45
- data/sub/eac_cli/lib/eac_cli/runner.rb +0 -46
- data/sub/eac_cli/lib/eac_cli/runner_with/confirmation/input_result.rb +0 -60
- data/sub/eac_cli/lib/eac_cli/runner_with/confirmation.rb +0 -63
- data/sub/eac_cli/lib/eac_cli/runner_with/help/builder/alternative.rb +0 -61
- data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +0 -79
- data/sub/eac_cli/lib/eac_cli/runner_with/help/layout.rb +0 -38
- data/sub/eac_cli/lib/eac_cli/runner_with/help.rb +0 -50
- data/sub/eac_cli/lib/eac_cli/runner_with/input.rb +0 -36
- data/sub/eac_cli/lib/eac_cli/runner_with/output/clipboard_writer.rb +0 -15
- data/sub/eac_cli/lib/eac_cli/runner_with/output.rb +0 -52
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/asciidoc_formatter/section.rb +0 -31
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/asciidoc_formatter.rb +0 -50
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/base_formatter.rb +0 -12
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/csv_formatter.rb +0 -21
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item/yaml_formatter.rb +0 -16
- data/sub/eac_cli/lib/eac_cli/runner_with/output_item.rb +0 -45
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list/base_formatter.rb +0 -44
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb +0 -24
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list/tty_formatter.rb +0 -34
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list/yaml_formatter.rb +0 -21
- data/sub/eac_cli/lib/eac_cli/runner_with/output_list.rb +0 -37
- data/sub/eac_cli/lib/eac_cli/runner_with/subcommands/definition_concern.rb +0 -10
- data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +0 -122
- data/sub/eac_cli/lib/eac_cli/runner_with_set/from_gems_registry.rb +0 -23
- data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +0 -49
- data/sub/eac_cli/lib/eac_cli/speaker/constants.rb +0 -11
- data/sub/eac_cli/lib/eac_cli/speaker/input_blocked.rb +0 -14
- data/sub/eac_cli/lib/eac_cli/speaker/input_requested.rb +0 -8
- data/sub/eac_cli/lib/eac_cli/speaker/list.rb +0 -83
- data/sub/eac_cli/lib/eac_cli/speaker/options.rb +0 -42
- data/sub/eac_cli/lib/eac_cli/speaker/request_from_list.rb +0 -40
- data/sub/eac_cli/lib/eac_cli/speaker.rb +0 -114
- data/sub/eac_cli/lib/eac_cli/version.rb +0 -5
- data/sub/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +0 -16
- data/sub/eac_cli/spec/lib/eac_cli/old_configs_spec.rb +0 -12
- data/sub/eac_cli/spec/lib/eac_cli/parser/alternative/subcommands_spec.rb +0 -55
- data/sub/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb +0 -86
- data/sub/eac_cli/spec/lib/eac_cli/runner/for_context_spec.rb +0 -77
- data/sub/eac_cli/spec/lib/eac_cli/runner_spec.rb +0 -127
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/confirmation/input_result_spec.rb +0 -32
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/confirmation_spec.rb +0 -40
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/help/layout_spec.rb +0 -19
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +0 -46
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/output_item/asciidoc_formatter_spec.rb +0 -26
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/output_item/asciidoc_formatter_spec_files/gb_1.source.yaml +0 -16
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/output_item/asciidoc_formatter_spec_files/gb_1.target.adoc +0 -22
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/output_list_spec.rb +0 -55
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/output_spec.rb +0 -78
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb +0 -95
- data/sub/eac_cli/spec/lib/eac_cli/speaker_spec.rb +0 -34
- data/sub/eac_ruby_utils/.avm.yaml +0 -3
- data/sub/eac_ruby_utils/.gitignore +0 -4
- data/sub/eac_ruby_utils/.gitrepo +0 -7
- data/sub/eac_ruby_utils/.rspec +0 -1
- data/sub/eac_ruby_utils/.rubocop.yml +0 -3
- data/sub/eac_ruby_utils/.yardopts +0 -1
- data/sub/eac_ruby_utils/Gemfile +0 -8
- data/sub/eac_ruby_utils/MIT-LICENCE +0 -16
- data/sub/eac_ruby_utils/README.rdoc +0 -3
- data/sub/eac_ruby_utils/eac_ruby_utils.gemspec +0 -27
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_abstract.rb +0 -100
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/array_accessor.rb +0 -25
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/base_accessor.rb +0 -57
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/boolean_accessor.rb +0 -16
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/class_methods.rb +0 -20
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/common_accessor.rb +0 -30
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/enumerable_accessor.rb +0 -52
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/hash_accessor.rb +0 -57
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/instance_methods.rb +0 -21
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/set_accessor.rb +0 -25
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable.rb +0 -16
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_instance_method.rb +0 -34
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/arguments_consumer.rb +0 -80
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/bit.rb +0 -47
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/bit_array.rb +0 -81
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/blank_not_blank.rb +0 -19
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb +0 -31
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/by_reference.rb +0 -23
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/byte.rb +0 -106
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/byte_array.rb +0 -36
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_concern/class_setup.rb +0 -53
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_concern/module_setup.rb +0 -42
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb +0 -20
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_accessors.rb +0 -36
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb +0 -39
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/instance_initialize.rb +0 -64
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/super_args.rb +0 -55
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +0 -95
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/compact.rb +0 -32
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/compare_by.rb +0 -28
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/context.rb +0 -33
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/contextualizable.rb +0 -19
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/core_ext.rb +0 -6
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/custom_format.rb +0 -51
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/enum.rb +0 -102
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/enumerables_methods.rb +0 -42
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/append_command_options.rb +0 -38
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb +0 -41
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/debugging.rb +0 -19
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/execution.rb +0 -52
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/extra_options.rb +0 -28
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command.rb +0 -45
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_env.rb +0 -28
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb +0 -27
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/extra_options.rb +0 -23
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +0 -67
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/composite_command.rb +0 -45
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +0 -93
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/execution_error.rb +0 -8
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/execution_result.rb +0 -45
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/file.rb +0 -22
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/local_env.rb +0 -17
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb +0 -27
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/spawn.rb +0 -32
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/dasho_options.rb +0 -51
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/identity_file.rb +0 -26
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/quiet.rb +0 -25
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/terminal.rb +0 -36
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env.rb +0 -74
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs.rb +0 -23
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/clearable_directory.rb +0 -57
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/extname.rb +0 -35
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/temp/directory.rb +0 -16
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/temp/file.rb +0 -34
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/temp.rb +0 -52
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs.rb +0 -11
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem/dependencies.rb +0 -33
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem/paths_to_require.rb +0 -55
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +0 -50
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +0 -34
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +0 -29
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/class_methods.rb +0 -14
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/instance_methods.rb +0 -30
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb +0 -23
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/item.rb +0 -48
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +0 -129
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/lists.rb +0 -51
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/string_list.rb +0 -19
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/symbol_list.rb +0 -19
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable.rb +0 -17
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +0 -48
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/from_all_gems.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/from_gem.rb +0 -47
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/module_i18n_translate.rb +0 -74
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/method_class.rb +0 -30
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/module_ancestors_variable/base.rb +0 -34
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/module_ancestors_variable/hash.rb +0 -20
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/module_ancestors_variable/set.rb +0 -19
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/module_ancestors_variable.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/objects_table.rb +0 -41
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/options_consumer.rb +0 -62
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patch_module.rb +0 -21
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/addressable/uri/query_value.rb +0 -37
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/addressable/uri.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/addressable.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/abstract.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/common_constructor.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/method_class.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/self_included_modules.rb +0 -7
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/settings_provider.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/static_method_class.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerable/boolean_combinations.rb +0 -45
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerable.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/stopped.rb +0 -14
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/if_key.rb +0 -12
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/options_consumer.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/sym_keys_hash.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/to_struct.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash.rb +0 -5
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/integer/rjust_zero.rb +0 -13
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/integer.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/ibr.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/acts_as_abstract.rb +0 -15
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/acts_as_immutable.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/acts_as_instance_method.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/common_concern.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/compare_by.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/context.rb +0 -11
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/enable_memoized.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/i18n_translate.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/immutable.rb +0 -11
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/listable.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/module_parent.rb +0 -5
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/patch_self.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/require_sub.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/simple_cache.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/speaker.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/asserts.rb +0 -25
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/call_if_proc.rb +0 -11
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/compact.rb +0 -20
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +0 -55
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/i18n_translate.rb +0 -11
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_nil.rb +0 -17
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_present.rb +0 -19
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_respond.rb +0 -22
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/recursive_build.rb +0 -12
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/to_bool.rb +0 -12
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/to_pathname.rb +0 -15
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/to_sym_by_eac.rb +0 -11
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/to_uri.rb +0 -15
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object.rb +0 -5
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/assert_parent.rb +0 -12
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_noext.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb +0 -13
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/child_of.rb +0 -16
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/if_exist.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/mkpath_s.rb +0 -12
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb +0 -11
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/readlink_r.rb +0 -11
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/reqdir_glob.rb +0 -13
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/if_match.rb +0 -16
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/to_parser.rb +0 -10
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/string/delimited.rb +0 -16
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +0 -11
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/string.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/time/required_zone.rb +0 -11
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/time.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches.rb +0 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/recursive_builder.rb +0 -51
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +0 -39
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub/base.rb +0 -93
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub/sub_file.rb +0 -64
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +0 -11
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/root_module_setup/ignore.rb +0 -57
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/root_module_setup.rb +0 -108
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +0 -23
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/conditionals.rb +0 -17
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/setup_manager.rb +0 -17
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +0 -27
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup_manager.rb +0 -49
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/stub_speaker.rb +0 -39
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb +0 -32
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_clean_environment.rb +0 -71
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_replace_objects/replace_instance_method.rb +0 -36
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_replace_objects.rb +0 -52
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby.rb +0 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/settings_provider/setting_value.rb +0 -79
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +0 -50
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +0 -77
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker/receiver.rb +0 -64
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker/sender.rb +0 -37
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker.rb +0 -16
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/static_method_class.rb +0 -12
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/string_delimited.rb +0 -70
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/struct.rb +0 -63
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/unimplemented_method_error.rb +0 -6
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +0 -5
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/wildcards.rb +0 -26
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +0 -107
- data/sub/eac_ruby_utils/lib/eac_ruby_utils.rb +0 -15
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/acts_as_abstract_spec.rb +0 -91
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/acts_as_immutable/array_accessor_spec.rb +0 -41
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/acts_as_immutable/common_accessor_spec.rb +0 -55
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/acts_as_immutable/hash_accessor_spec.rb +0 -40
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/acts_as_immutable/set_accessor_spec.rb +0 -41
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/arguments_consumer_spec.rb +0 -15
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/bit_array_spec.rb +0 -20
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/blank_not_blank_spec.rb +0 -14
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/byte_spec.rb +0 -52
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb +0 -63
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +0 -149
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/compact_spec.rb +0 -19
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/compare_by_spec.rb +0 -37
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/custom_format_spec.rb +0 -58
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/enum_spec.rb +0 -42
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/enumerables_methods_spec.rb +0 -48
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/command/base_example.rb +0 -95
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/command/local_env_spec.rb +0 -9
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/command/ssh_env_spec.rb +0 -16
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/executable_spec.rb +0 -34
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/ssh_env_spec.rb +0 -23
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/extname_spec.rb +0 -16
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/directory_spec.rb +0 -10
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb +0 -50
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/gems_registry_spec.rb +0 -14
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb +0 -14
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb +0 -223
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/local_time_zone_spec.rb +0 -15
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/method_class_spec.rb +0 -45
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/module_ancestors_variable/hash_spec.rb +0 -55
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/module_ancestors_variable/set_spec.rb +0 -55
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb +0 -78
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/addressable/uri/query_value_spec.rb +0 -23
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/abstract_spec.rb +0 -23
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/acts_as_abstract_spec.rb +0 -11
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/method_class_spec.rb +0 -17
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/self_included_modules_spec.rb +0 -28
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/static_method_class_spec.rb +0 -17
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerable/boolean_combinations_spec.rb +0 -37
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb +0 -24
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/stopped_spec.rb +0 -30
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/if_key_spec.rb +0 -21
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/options_consumer_spec.rb +0 -15
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/sym_keys_hash_spec.rb +0 -11
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/integer/rjust_zero_spec.rb +0 -18
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/compare_by_spec.rb +0 -35
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/listable_spec.rb +0 -13
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/simple_cache_spec.rb +0 -13
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/speaker_spec.rb +0 -13
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/call_if_proc_spec.rb +0 -9
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/compact_spec.rb +0 -18
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/if_present_spec.rb +0 -11
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/recursive_build_spec.rb +0 -60
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/template_spec_files/path/my_stub_with_template +0 -1
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/assert_parent_spec.rb +0 -19
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb +0 -24
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_sub_spec.rb +0 -15
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/child_of_spec.rb +0 -24
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/parent_n_spec.rb +0 -31
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb +0 -32
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb +0 -63
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub/base_spec/stubbed_module_a.rb +0 -6
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub/base_spec/stubbed_not_module.rb +0 -6
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub/base_spec.rb +0 -17
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/rspec/setup/setup_manager_spec.rb +0 -14
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb +0 -29
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_replace_objects_spec.rb +0 -63
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +0 -62
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +0 -127
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/static_method_class_spec.rb +0 -43
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/struct_spec.rb +0 -55
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/wildcards_spec.rb +0 -25
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/yaml_spec.rb +0 -73
- data/sub/eac_ruby_utils/spec/locales/pt-BR.yml +0 -58
- data/sub/eac_ruby_utils/spec/meta/rubocop_check_spec.rb +0 -3
- data/sub/eac_ruby_utils/spec/spec_helper.rb +0 -11
- /data/sub/{eac_cli → eac_ruby_base0}/.gitignore +0 -0
- /data/sub/{eac_cli → eac_ruby_base0}/.rspec +0 -0
- /data/sub/{eac_cli → eac_ruby_base0}/.rubocop.yml +0 -0
- /data/sub/{eac_cli → eac_ruby_base0}/Gemfile +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Object, '#recursive_build' do
|
|
4
|
-
let(:item_class) do
|
|
5
|
-
Class.new do
|
|
6
|
-
class << self
|
|
7
|
-
def create(label, dependencies_keys)
|
|
8
|
-
item = new(label, dependencies_keys)
|
|
9
|
-
registry[item.label] = item
|
|
10
|
-
item
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def registry
|
|
14
|
-
@registry ||= {}
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
attr_reader :label, :dependencies_keys
|
|
19
|
-
|
|
20
|
-
def initialize(label, dependencies_keys)
|
|
21
|
-
@label = label
|
|
22
|
-
@dependencies_keys = dependencies_keys.freeze
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def dependencies
|
|
26
|
-
dependencies_keys.map { |key| self.class.registry.fetch(key) }
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def to_s
|
|
30
|
-
label
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
items = [
|
|
36
|
-
[:a, %w[c], %w[a c]],
|
|
37
|
-
[:b, %w[a], %w[b a c]],
|
|
38
|
-
[:c, [], %w[c]],
|
|
39
|
-
[:d, %w[a b c e], %w[d a b c e]],
|
|
40
|
-
[:e, %w[c b], %w[e c b a]]
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
items.each do |item|
|
|
44
|
-
let(item[0]) { item_class.create(item[0].to_s, item[1]) }
|
|
45
|
-
before { send(item[0]) }
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
describe '#result' do
|
|
49
|
-
items.each do |item|
|
|
50
|
-
context "when root is \"#{item[0]}\"" do
|
|
51
|
-
let(:root) { send(item[0]) }
|
|
52
|
-
let(:dependencies) { item[2].map { |d| send(d) } }
|
|
53
|
-
|
|
54
|
-
it "is #{item[2]}" do
|
|
55
|
-
expect(root.recursive_build(&:dependencies)).to eq(dependencies)
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Pathname, '#assert_parent' do
|
|
4
|
-
let(:root) { temp_dir }
|
|
5
|
-
let(:parent_dir) { root.join('parent_dir') }
|
|
6
|
-
let(:instance) { parent_dir.join('the_file') }
|
|
7
|
-
let(:result) { instance.assert_parent }
|
|
8
|
-
|
|
9
|
-
it { expect(parent_dir).not_to exist }
|
|
10
|
-
it { expect(instance).not_to exist }
|
|
11
|
-
|
|
12
|
-
context 'when parent is asserted' do
|
|
13
|
-
before { result }
|
|
14
|
-
|
|
15
|
-
it { expect(parent_dir).to exist }
|
|
16
|
-
it { expect(instance).not_to exist }
|
|
17
|
-
it { expect(result).to eq(instance) }
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Pathname, '#basename_noext' do
|
|
4
|
-
describe '#basename_noext' do
|
|
5
|
-
{
|
|
6
|
-
'After.Life.S01E01.WEBRip.x264-ION10.mp4' =>
|
|
7
|
-
%w[After.Life.S01E01.WEBRip.x264-ION10 After.Life.S01E01.WEBRip.x264-ION10.mp4
|
|
8
|
-
After.Life.S01E01.WEBRip.x264-ION10 After.Life.S01E01.WEBRip.x264-ION10],
|
|
9
|
-
's01e01.en.srt' => %w[s01e01 s01e01.en.srt s01e01.en s01e01 s01e01],
|
|
10
|
-
's01e01.srt' => %w[s01e01 s01e01.srt s01e01 s01e01 s01e01],
|
|
11
|
-
'/path/to/file.tar.gz' => %w[file file.tar.gz file.tar file file]
|
|
12
|
-
}.each do |source, expected_values|
|
|
13
|
-
expected_values.each_with_index do |expected_value, index|
|
|
14
|
-
limit = index - 1 # rubocop:disable RSpec/LeakyLocalVariable
|
|
15
|
-
context "when source is \"#{source}\" and limit is \"#{limit}\"" do
|
|
16
|
-
let(:instance) { described_class.new(source) }
|
|
17
|
-
let(:expected_path) { described_class.new(expected_value) }
|
|
18
|
-
|
|
19
|
-
it { expect(instance.basename_noext(limit)).to eq(expected_path) }
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Pathname, '#basename_sub' do
|
|
4
|
-
it do
|
|
5
|
-
expect(described_class.new('/absolute/path/to/file').basename_sub { |_b| 'other_file' }).to eq(
|
|
6
|
-
described_class.new('/absolute/path/to/other_file')
|
|
7
|
-
)
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
it do
|
|
11
|
-
expect(described_class.new('file').basename_sub { |b| "#{b}_appended" }).to eq(
|
|
12
|
-
described_class.new('file_appended')
|
|
13
|
-
)
|
|
14
|
-
end
|
|
15
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Pathname, '#child_of' do
|
|
4
|
-
describe 'child_of?' do
|
|
5
|
-
[
|
|
6
|
-
['/foo/bar/baz', '/foo/bar', true],
|
|
7
|
-
['/foo/../foo/bar/../bar/baz', '/foo/bar', true],
|
|
8
|
-
['/foo/bar/baz', '/foo/../foo/bar/../bar', true],
|
|
9
|
-
['/foo/bar/baz', '/boink', false],
|
|
10
|
-
['/foo/bar/../not_bar/baz', '/foo/bar', false],
|
|
11
|
-
['/foo/bar/../bar_not/baz', '/foo/bar', false],
|
|
12
|
-
['/foo', '/foo/bar', false],
|
|
13
|
-
['/foo', '/bar', false],
|
|
14
|
-
['/foo', '/foo', false]
|
|
15
|
-
].each do |test_values|
|
|
16
|
-
child_path, parent_path, expected_value = test_values # rubocop:disable RSpec/LeakyLocalVariable
|
|
17
|
-
context "when child=\"#{child_path}\" and parent=\"#{parent_path}\"" do
|
|
18
|
-
it do
|
|
19
|
-
expect(Pathname(child_path).child_of?(Pathname(parent_path))).to be(expected_value)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Pathname, '#parent_n' do
|
|
4
|
-
[
|
|
5
|
-
['/absolute/path/to/file', 0, '/absolute/path/to/file'],
|
|
6
|
-
['/absolute/path/to/file', 1, '/absolute/path/to'],
|
|
7
|
-
['/absolute/path/to/file', 2, '/absolute/path'],
|
|
8
|
-
['/absolute/path/to/file', 3, '/absolute'],
|
|
9
|
-
['/absolute/path/to/file', 4, '/'],
|
|
10
|
-
['/absolute/path/to/file', 5, '/'],
|
|
11
|
-
['relative/path/to/file', 0, 'relative/path/to/file'],
|
|
12
|
-
['relative/path/to/file', 1, 'relative/path/to'],
|
|
13
|
-
['relative/path/to/file', 2, 'relative/path'],
|
|
14
|
-
['relative/path/to/file', 3, 'relative'],
|
|
15
|
-
['relative/path/to/file', 4, '.'],
|
|
16
|
-
['relative/path/to/file', 5, '..'],
|
|
17
|
-
['relative/path/to/file', 6, '../..']
|
|
18
|
-
].each do |test_data|
|
|
19
|
-
input_path = test_data[0] # rubocop:disable RSpec/LeakyLocalVariable
|
|
20
|
-
context "when path is \"#{input_path}\"" do
|
|
21
|
-
let(:n) { test_data[1] }
|
|
22
|
-
let(:expected_path) { test_data[2] }
|
|
23
|
-
|
|
24
|
-
it do
|
|
25
|
-
expect(described_class.new(input_path).parent_n(n)).to(
|
|
26
|
-
eq(described_class.new(expected_path))
|
|
27
|
-
)
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe String, '#delimeted' do # rubocop:disable RSpec/SpecFilePathFormat
|
|
4
|
-
let(:instance) { 'A text with <b>content between</b> tags.' }
|
|
5
|
-
|
|
6
|
-
{
|
|
7
|
-
['<b>', '</b>'] => {
|
|
8
|
-
'inner' => 'content between',
|
|
9
|
-
'without_inner' => 'A text with <b></b> tags.',
|
|
10
|
-
'outer' => '<b>content between</b>',
|
|
11
|
-
'without_outer' => 'A text with tags.'
|
|
12
|
-
},
|
|
13
|
-
['<b>', '</br>'] => {
|
|
14
|
-
'inner' => '',
|
|
15
|
-
'without_inner' => 'A text with <b>content between</b> tags.',
|
|
16
|
-
'outer' => '',
|
|
17
|
-
'without_outer' => 'A text with <b>content between</b> tags.'
|
|
18
|
-
}
|
|
19
|
-
}.each do |delimiters, expected_values|
|
|
20
|
-
context "when delimiters are #{delimiters}" do
|
|
21
|
-
let(:bdel) { delimiters[0] }
|
|
22
|
-
let(:edel) { delimiters[1] }
|
|
23
|
-
|
|
24
|
-
expected_values.each do |method_suffix, expected_value|
|
|
25
|
-
method_name = "delimited_#{method_suffix}" # rubocop:disable RSpec/LeakyLocalVariable
|
|
26
|
-
it "#{method_name} should return \"#{expected_value}\"" do
|
|
27
|
-
expect(instance.send(method_name, bdel, edel)).to eq(expected_value)
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe EacRubyUtils::RecursiveBuilder do
|
|
4
|
-
let(:item_class) do
|
|
5
|
-
Class.new do
|
|
6
|
-
class << self
|
|
7
|
-
def create(label, dependencies_keys)
|
|
8
|
-
item = new(label, dependencies_keys)
|
|
9
|
-
registry[item.label] = item
|
|
10
|
-
item
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def registry
|
|
14
|
-
@registry ||= {}
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
attr_reader :label, :dependencies_keys
|
|
19
|
-
|
|
20
|
-
def initialize(label, dependencies_keys)
|
|
21
|
-
@label = label
|
|
22
|
-
@dependencies_keys = dependencies_keys.freeze
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def dependencies
|
|
26
|
-
dependencies_keys.map { |key| self.class.registry.fetch(key) }
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def to_s
|
|
30
|
-
label
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
items = [
|
|
36
|
-
[:a, %w[c], %w[a c]],
|
|
37
|
-
[:b, %w[a], %w[b a c]],
|
|
38
|
-
[:c, [], %w[c]],
|
|
39
|
-
[:d, %w[a b c e], %w[d a b c e]],
|
|
40
|
-
[:e, %w[c b], %w[e c b a]]
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
items.each do |item|
|
|
44
|
-
let(item[0]) { item_class.create(item[0].to_s, item[1]) }
|
|
45
|
-
before { send(item[0]) }
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
describe '#result' do
|
|
49
|
-
items.each do |item|
|
|
50
|
-
context "when root is \"#{item[0]}\"" do
|
|
51
|
-
let(:root) { send(item[0]) }
|
|
52
|
-
let(:dependencies) { item[2].map { |d| send(d) } }
|
|
53
|
-
let(:builder) do
|
|
54
|
-
described_class.new(root, &:dependencies)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
it "is #{item[2]}" do
|
|
58
|
-
expect(builder.result).to eq(dependencies)
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class RequireSubStubClass # rubocop:disable Lint/EmptyClass
|
|
4
|
-
end
|
|
5
|
-
|
|
6
|
-
RSpec.describe EacRubyUtils::RequireSub::Base do
|
|
7
|
-
let(:instance) { described_class.new(__FILE__, base: RequireSubStubClass, include_modules: true) }
|
|
8
|
-
|
|
9
|
-
before do
|
|
10
|
-
instance.apply
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it do
|
|
14
|
-
expect(RequireSubStubClass.included_modules)
|
|
15
|
-
.to include(RequireSubStubClass::StubbedModuleA)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe(EacRubyUtils::Rspec::Setup::SetupManager) do
|
|
4
|
-
describe '#setup_manager' do
|
|
5
|
-
it do
|
|
6
|
-
expect(setup_manager).to be_a(EacRubyUtils::Rspec::SetupManager)
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
describe '#app_root_path' do
|
|
11
|
-
it { expect(app_root_path).to be_a(Pathname) }
|
|
12
|
-
it { expect(app_root_path).to be_directory }
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe EacRubyUtils::Ruby, '#on_clean_environment' do
|
|
4
|
-
let(:envvar_name) { 'BUNDLE_NOT_EXISTENT_ENV_VAR' }
|
|
5
|
-
let(:envvar_value) { 'any value' }
|
|
6
|
-
let(:noruby_envvar_name) { 'ANY_ENVIRONMENT_VARIABLE' }
|
|
7
|
-
let(:noruby_envvar_value) { 'another any value' }
|
|
8
|
-
|
|
9
|
-
before do
|
|
10
|
-
ENV[envvar_name] = envvar_value
|
|
11
|
-
ENV[noruby_envvar_name] = noruby_envvar_value
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
it do # rubocop:disable RSpec/MultipleExpectations
|
|
15
|
-
expect(ENV.fetch(envvar_name, nil)).to eq(envvar_value)
|
|
16
|
-
described_class.on_clean_environment do
|
|
17
|
-
expect(ENV.fetch(envvar_name, nil)).to be_nil
|
|
18
|
-
end
|
|
19
|
-
expect(ENV.fetch(envvar_name, nil)).to eq(envvar_value)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it do # rubocop:disable RSpec/MultipleExpectations
|
|
23
|
-
expect(ENV.fetch(noruby_envvar_name, nil)).to eq(noruby_envvar_value)
|
|
24
|
-
described_class.on_clean_environment do
|
|
25
|
-
expect(ENV.fetch(noruby_envvar_name, nil)).to eq(noruby_envvar_value)
|
|
26
|
-
end
|
|
27
|
-
expect(ENV.fetch(noruby_envvar_name, nil)).to eq(noruby_envvar_value)
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe EacRubyUtils::Ruby, '#on_replace_objects' do
|
|
4
|
-
let(:stub_class) do
|
|
5
|
-
Class.new do
|
|
6
|
-
def self.my_class_method
|
|
7
|
-
'Original'
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def my_instance_method
|
|
11
|
-
'Original'
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
let(:stub_instance) { stub_class.new }
|
|
17
|
-
|
|
18
|
-
let(:replace_block) do
|
|
19
|
-
proc { 'Replaced' }
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
describe '#my_instance_method' do
|
|
23
|
-
let(:before) { stub_instance.my_instance_method }
|
|
24
|
-
let(:inside) do
|
|
25
|
-
described_class.on_replace_objects do |replacer|
|
|
26
|
-
replacer.replace_instance_method(stub_class, :my_instance_method, &replace_block)
|
|
27
|
-
stub_instance.my_instance_method
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
let(:after) { stub_instance.my_instance_method }
|
|
31
|
-
|
|
32
|
-
before do
|
|
33
|
-
before
|
|
34
|
-
inside
|
|
35
|
-
after
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it { expect(before).to eq('Original') }
|
|
39
|
-
it { expect(inside).to eq('Replaced') }
|
|
40
|
-
it { expect(after).to eq('Original') }
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
describe '#replace_self_method' do
|
|
44
|
-
let(:before) { stub_class.my_class_method }
|
|
45
|
-
let(:inside) do
|
|
46
|
-
described_class.on_replace_objects do |replacer|
|
|
47
|
-
replacer.replace_self_method(stub_class, :my_class_method, &replace_block)
|
|
48
|
-
stub_class.my_class_method
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
let(:after) { stub_class.my_class_method }
|
|
52
|
-
|
|
53
|
-
before do
|
|
54
|
-
before
|
|
55
|
-
inside
|
|
56
|
-
after
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
it { expect(before).to eq('Original') }
|
|
60
|
-
it { expect(inside).to eq('Replaced') }
|
|
61
|
-
it { expect(after).to eq('Original') }
|
|
62
|
-
end
|
|
63
|
-
end
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe EacRubyUtils::SettingsProvider do
|
|
4
|
-
let(:stub_class) do
|
|
5
|
-
the_described_class = described_class
|
|
6
|
-
r = Class.new do
|
|
7
|
-
include the_described_class
|
|
8
|
-
|
|
9
|
-
def key_a
|
|
10
|
-
'method_a'
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def key_b
|
|
14
|
-
'method_b'
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def key_f
|
|
18
|
-
nil
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def settings
|
|
22
|
-
{ 'key_b' => 'setting_b', key_c: 'setting_c' }
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
r.const_set(:KEY_A, 'constant_a')
|
|
26
|
-
r.const_set(:KEY_D, 'constant_d')
|
|
27
|
-
r
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
let(:stub) { stub_class.new }
|
|
31
|
-
|
|
32
|
-
describe '#setting_value' do
|
|
33
|
-
{
|
|
34
|
-
['key_a'] => 'method_a',
|
|
35
|
-
[:key_b] => 'setting_b',
|
|
36
|
-
['key_b', { order: %w[constant method settings_object] }] => 'method_b',
|
|
37
|
-
['key_c'] => 'setting_c',
|
|
38
|
-
['key_d'] => 'constant_d',
|
|
39
|
-
['key_f'] => nil
|
|
40
|
-
}.each do |args, expected_value|
|
|
41
|
-
context "when args are \"#{args}\"" do
|
|
42
|
-
it { expect(stub.setting_value(*args)).to eq(expected_value) }
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
it do
|
|
47
|
-
expect { stub.setting_value('key_e') }.to raise_error(StandardError)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
it do
|
|
51
|
-
expect(stub.setting_value('key_e', required: false)).to be_nil
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
it do
|
|
55
|
-
expect(stub.setting_value('key_e', default: nil)).to be_nil
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
it do
|
|
59
|
-
expect(stub.setting_value('key_e', default: 'default_e')).to eq('default_e')
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class CacheableObject
|
|
4
|
-
include ::EacRubyUtils::SimpleCache
|
|
5
|
-
|
|
6
|
-
def my_method_uncached
|
|
7
|
-
@counter ||= 0
|
|
8
|
-
@counter += 1
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def method_with_question_uncached? # rubocop:disable Naming/PredicateMethod
|
|
12
|
-
'question'
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def method_with_exclamation_uncached!
|
|
16
|
-
'exclamation'
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def method_with_args_uncached(arg1)
|
|
20
|
-
@counter2 ||= 0
|
|
21
|
-
@counter2 += 1
|
|
22
|
-
"#{arg1}/#{@counter2}"
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def method_with_reset_uncached
|
|
26
|
-
reset_cache
|
|
27
|
-
'result'
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
def private_method_uncached
|
|
33
|
-
@counter3 ||= 0
|
|
34
|
-
@counter3 += 1
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
RSpec.describe EacRubyUtils::SimpleCache do
|
|
39
|
-
let(:instance) { CacheableObject.new }
|
|
40
|
-
|
|
41
|
-
describe 'cached value' do
|
|
42
|
-
it 'uncached method return value should update at each call' do
|
|
43
|
-
expect(instance.my_method_uncached).not_to eq(instance.my_method_uncached)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
it 'cached method should return same values at each call' do
|
|
47
|
-
expect(instance.my_method).to eq(instance.my_method) # rubocop:disable RSpec/IdenticalEqualityAssertion
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
it 'is able to call private uncached as cached' do
|
|
51
|
-
expect(instance.private_method).to eq(instance.private_method) # rubocop:disable RSpec/IdenticalEqualityAssertion
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
it 'return value even if reset cache' do
|
|
55
|
-
expect(instance.method_with_reset).to eq('result')
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
describe 'cache value with args' do
|
|
60
|
-
it do
|
|
61
|
-
expect(instance.method_with_args_uncached('123'))
|
|
62
|
-
.not_to eq(instance.method_with_args_uncached('123'))
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
it do
|
|
66
|
-
expect(instance.method_with_args_uncached('456'))
|
|
67
|
-
.not_to eq(instance.method_with_args_uncached('456'))
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
it do
|
|
71
|
-
expect(instance.method_with_args('123')).to eq(instance.method_with_args('123')) # rubocop:disable RSpec/IdenticalEqualityAssertion
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
it do
|
|
75
|
-
expect(instance.method_with_args('456')).to eq(instance.method_with_args('456')) # rubocop:disable RSpec/IdenticalEqualityAssertion
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
it do
|
|
79
|
-
expect(instance.method_with_args('456')).not_to eq(instance.method_with_args('123'))
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
describe 'method with marks' do
|
|
84
|
-
it 'found uncached method with exclamation mark' do
|
|
85
|
-
expect(instance.method_with_exclamation!).to eq('exclamation')
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
it 'found uncached method with question mark' do
|
|
89
|
-
expect(instance.method_with_question?).to eq('question')
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
describe '#respond_to?' do
|
|
94
|
-
it 'responds to cached method without args' do
|
|
95
|
-
expect(instance.respond_to?(:my_method)).to be(true)
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
it 'responds to cached method with args' do
|
|
99
|
-
expect(instance.respond_to?(:method_with_args)).to be(true)
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
it 'responds to cached method of uncached private method' do
|
|
103
|
-
expect(instance.respond_to?(:private_method)).to be(true)
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
it 'not respond to not existent method' do
|
|
107
|
-
expect(instance.respond_to?(:not_exist)).to be(false)
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
describe '#reset_cache' do
|
|
112
|
-
let(:instance) { CacheableObject.new }
|
|
113
|
-
let(:cached_value) { instance.my_method }
|
|
114
|
-
|
|
115
|
-
it 'cached method return should return cached value' do
|
|
116
|
-
expect(instance.my_method).to eq(cached_value)
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
context 'when reset_cache method is called' do
|
|
120
|
-
it 'cached method return should return new cached value' do
|
|
121
|
-
cached_value
|
|
122
|
-
instance.reset_cache
|
|
123
|
-
expect(instance.my_method).not_to eq(cached_value)
|
|
124
|
-
end
|
|
125
|
-
end
|
|
126
|
-
end
|
|
127
|
-
end
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe EacRubyUtils::StaticMethodClass do
|
|
4
|
-
let(:sender_class) do
|
|
5
|
-
Class.new do
|
|
6
|
-
class << self
|
|
7
|
-
def sender_value
|
|
8
|
-
'AAA'
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
let(:method_class) do
|
|
15
|
-
the_described_class = described_class
|
|
16
|
-
Class.new do
|
|
17
|
-
def self.name
|
|
18
|
-
'TheSender::PerformX'
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
include the_described_class
|
|
22
|
-
|
|
23
|
-
attr_accessor :sender, :method_param
|
|
24
|
-
|
|
25
|
-
def initialize(sender, method_param)
|
|
26
|
-
self.sender = sender
|
|
27
|
-
self.method_param = method_param
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def result
|
|
31
|
-
"#{sender.sender_value},#{method_param}"
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
before do
|
|
37
|
-
Object.const_set('TheSender', sender_class)
|
|
38
|
-
sender_class.const_set('PerformX', method_class)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
it { expect(sender_class).to respond_to(:perform_x) }
|
|
42
|
-
it { expect(sender_class.perform_x('BBB')).to eq('AAA,BBB') }
|
|
43
|
-
end
|