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,45 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe EacRubyUtils::MethodClass do
|
|
4
|
-
let(:sender_class) do
|
|
5
|
-
Class.new do
|
|
6
|
-
attr_accessor :sender_value
|
|
7
|
-
|
|
8
|
-
def initialize(sender_value)
|
|
9
|
-
self.sender_value = sender_value
|
|
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
|
-
let(:sender_instance) { sender_class.new('AAA') }
|
|
37
|
-
|
|
38
|
-
before do
|
|
39
|
-
Object.const_set('TheSender', sender_class)
|
|
40
|
-
sender_class.const_set('PerformX', method_class)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it { expect(sender_instance).to respond_to(:perform_x) }
|
|
44
|
-
it { expect(sender_instance.perform_x('BBB')).to eq('AAA,BBB') }
|
|
45
|
-
end
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe(EacRubyUtils::ModuleAncestorsVariable::Hash) do
|
|
4
|
-
let(:included_module) do
|
|
5
|
-
Module.new do
|
|
6
|
-
def self.included(base)
|
|
7
|
-
base.extend(ClassMethods)
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
module ClassMethods # rubocop:disable Lint/ConstantDefinitionInBlock, RSpec/LeakyConstantDeclaration
|
|
11
|
-
def hash_variable
|
|
12
|
-
@hash_variable ||= ::EacRubyUtils::ModuleAncestorsVariable::Hash.new(self, __method__)
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
let(:super_class) do
|
|
19
|
-
r = Class.new
|
|
20
|
-
r.include included_module
|
|
21
|
-
r
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
let(:sub_class) do
|
|
25
|
-
Class.new(super_class)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it { expect(super_class.hash_variable).to be_a(described_class) }
|
|
29
|
-
it { expect(super_class.hash_variable.self_variable).to eq({}) }
|
|
30
|
-
it { expect(super_class.hash_variable.ancestors_variable).to eq({}) }
|
|
31
|
-
it { expect(super_class.hash_variable.to_h).to eq({}) }
|
|
32
|
-
|
|
33
|
-
it { expect(sub_class.hash_variable).to be_a(described_class) }
|
|
34
|
-
it { expect(sub_class.hash_variable.self_variable).to eq({}) }
|
|
35
|
-
it { expect(sub_class.hash_variable.ancestors_variable).to eq({}) }
|
|
36
|
-
it { expect(sub_class.hash_variable.to_h).to eq({}) }
|
|
37
|
-
|
|
38
|
-
context 'when super class is changed' do
|
|
39
|
-
before do
|
|
40
|
-
super_class.hash_variable[:by_super] = 1
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it { expect(super_class.hash_variable.to_h).to eq({ by_super: 1 }) }
|
|
44
|
-
it { expect(sub_class.hash_variable.to_h).to eq({ by_super: 1 }) }
|
|
45
|
-
|
|
46
|
-
context 'when sub class is changed' do
|
|
47
|
-
before do
|
|
48
|
-
sub_class.hash_variable[:by_sub] = 2
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
it { expect(super_class.hash_variable.to_h).to eq({ by_super: 1 }) }
|
|
52
|
-
it { expect(sub_class.hash_variable.to_h).to eq({ by_super: 1, by_sub: 2 }) }
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe(EacRubyUtils::ModuleAncestorsVariable::Set) do
|
|
4
|
-
let(:included_module) do
|
|
5
|
-
Module.new do
|
|
6
|
-
def self.included(base)
|
|
7
|
-
base.extend(ClassMethods)
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
module ClassMethods # rubocop:disable Lint/ConstantDefinitionInBlock, RSpec/LeakyConstantDeclaration
|
|
11
|
-
def set_variable
|
|
12
|
-
@set_variable ||= ::EacRubyUtils::ModuleAncestorsVariable::Set.new(self, __method__)
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
let(:super_class) do
|
|
19
|
-
r = Class.new
|
|
20
|
-
r.include included_module
|
|
21
|
-
r
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
let(:sub_class) do
|
|
25
|
-
Class.new(super_class)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it { expect(super_class.set_variable).to be_a(described_class) }
|
|
29
|
-
it { expect(super_class.set_variable.self_variable).to eq(Set.new) }
|
|
30
|
-
it { expect(super_class.set_variable.ancestors_variable).to eq(Set.new) }
|
|
31
|
-
it { expect(super_class.set_variable.to_set).to eq(Set.new) }
|
|
32
|
-
|
|
33
|
-
it { expect(sub_class.set_variable).to be_a(described_class) }
|
|
34
|
-
it { expect(sub_class.set_variable.self_variable).to eq(Set.new) }
|
|
35
|
-
it { expect(sub_class.set_variable.ancestors_variable).to eq(Set.new) }
|
|
36
|
-
it { expect(sub_class.set_variable.to_set).to eq(Set.new) }
|
|
37
|
-
|
|
38
|
-
context 'when super class is changed' do
|
|
39
|
-
before do
|
|
40
|
-
super_class.set_variable << 1
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it { expect(super_class.set_variable.to_set).to eq(Set.new([1])) }
|
|
44
|
-
it { expect(sub_class.set_variable.to_set).to eq(Set.new([1])) }
|
|
45
|
-
|
|
46
|
-
context 'when sub class is changed' do
|
|
47
|
-
before do
|
|
48
|
-
sub_class.set_variable << 2
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
it { expect(super_class.set_variable.to_set).to eq(Set.new([1])) }
|
|
52
|
-
it { expect(sub_class.set_variable.to_set).to eq(Set.new([1, 2])) }
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe EacRubyUtils::OptionsConsumer do
|
|
4
|
-
context 'with instance created with some data' do
|
|
5
|
-
subject(:instance) { described_class.new(a: 'a_value', b: 'b_value', c: 'c_value') }
|
|
6
|
-
|
|
7
|
-
let(:consumed_a) { instance.consume(:a) }
|
|
8
|
-
let(:consumed_b) { instance.consume(:b) }
|
|
9
|
-
let(:consumed_c) { instance.consume(:c) }
|
|
10
|
-
|
|
11
|
-
it 'left data should be Hash' do
|
|
12
|
-
expect(instance.left_data).to be_a(Hash)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
it 'left data should be not empty' do
|
|
16
|
-
expect { instance.validate }.to raise_error(StandardError)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
context 'when no data is consumed' do
|
|
20
|
-
it do
|
|
21
|
-
expect(instance.left_data).to eq({ a: 'a_value', b: 'b_value', c: 'c_value' }
|
|
22
|
-
.with_indifferent_access)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it { expect(consumed_a).to eq('a_value') }
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
context 'when A value is consumed' do
|
|
29
|
-
before { consumed_a }
|
|
30
|
-
|
|
31
|
-
it do
|
|
32
|
-
expect(instance.left_data).to eq({ b: 'b_value', c: 'c_value' }.with_indifferent_access)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
it { expect(instance.consume(:c)).to eq('c_value') }
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
context 'when A and C values are consumed' do
|
|
39
|
-
before do
|
|
40
|
-
consumed_a
|
|
41
|
-
consumed_c
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
it { expect(instance.left_data).to eq({ b: 'b_value' }.with_indifferent_access) }
|
|
45
|
-
|
|
46
|
-
it { expect(consumed_b).to eq('b_value') }
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
context 'when all values are consumed' do
|
|
50
|
-
before do
|
|
51
|
-
consumed_a
|
|
52
|
-
consumed_b
|
|
53
|
-
consumed_c
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
it { expect(instance.left_data).to eq({}.with_indifferent_access) }
|
|
57
|
-
|
|
58
|
-
it do
|
|
59
|
-
expect { instance.validate }.not_to raise_error
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
it 'raises if validate has left data' do
|
|
64
|
-
expect(instance.left_data.empty?).to be(false)
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
describe '#consume_all' do
|
|
69
|
-
subject(:instance) { described_class.new(a: 'a_value', b: 'b_value', c: 'c_value') }
|
|
70
|
-
|
|
71
|
-
let(:all_consumed) { instance.consume_all(:a, :b, :c, :d) }
|
|
72
|
-
|
|
73
|
-
it { expect(all_consumed[0]).to eq('a_value') }
|
|
74
|
-
it { expect(all_consumed[1]).to eq('b_value') }
|
|
75
|
-
it { expect(all_consumed[2]).to eq('c_value') }
|
|
76
|
-
it { expect(all_consumed[3]).to be_nil }
|
|
77
|
-
end
|
|
78
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Addressable::URI, '#query_value' do
|
|
4
|
-
subject(:instance) { described_class.parse('http://example.net') }
|
|
5
|
-
|
|
6
|
-
it { expect(instance.query_values).to be_nil }
|
|
7
|
-
it { expect(instance.hash_query_values).to eq({}) }
|
|
8
|
-
|
|
9
|
-
it { expect(instance.query_value('param1')).to be_nil }
|
|
10
|
-
it { expect(instance.query_value(:param1)).to be_nil }
|
|
11
|
-
|
|
12
|
-
context 'when param is set' do
|
|
13
|
-
let(:set_result) { instance.query_value(:param1, :value1) }
|
|
14
|
-
|
|
15
|
-
before { set_result }
|
|
16
|
-
|
|
17
|
-
it { expect(set_result).to eq(instance) }
|
|
18
|
-
it { expect(instance.query_values).to eq({ 'param1' => 'value1' }) }
|
|
19
|
-
it { expect(instance.hash_query_values).to eq({ 'param1' => 'value1' }) }
|
|
20
|
-
it { expect(instance.query_value('param1')).to eq('value1') }
|
|
21
|
-
it { expect(instance.query_value(:param1)).to eq('value1') }
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Class, '#abstract' do
|
|
4
|
-
let(:abstract_class) do
|
|
5
|
-
described_class.new do
|
|
6
|
-
acts_as_abstract
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
let(:concrect_class) do
|
|
11
|
-
described_class.new(abstract_class)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
describe '#abstract' do
|
|
15
|
-
it do
|
|
16
|
-
expect(abstract_class).to be_abstract
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it do
|
|
20
|
-
expect(concrect_class).not_to be_abstract
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Class, '#acts_as_abstract' do
|
|
4
|
-
let(:stub_class) do
|
|
5
|
-
described_class.new { acts_as_abstract }
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
describe '#acts_as_abstract' do
|
|
9
|
-
it { expect(stub_class.included_modules).to include(EacRubyUtils::ActsAsAbstract) }
|
|
10
|
-
end
|
|
11
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Class, '#method_class' do
|
|
4
|
-
let(:stub_method_class) do
|
|
5
|
-
described_class.new do
|
|
6
|
-
def self.name
|
|
7
|
-
'StubMethodClass'
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
enable_method_class
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
describe '#enable_simple_cache' do
|
|
15
|
-
it { expect(stub_method_class.included_modules).to include(EacRubyUtils::MethodClass) }
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Class, '#self_included_modules' do
|
|
4
|
-
let(:includeable_module) do
|
|
5
|
-
Module.new
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
let(:parent_class) do
|
|
9
|
-
module_to_include = includeable_module
|
|
10
|
-
described_class.new do
|
|
11
|
-
include module_to_include
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
let(:child_class) do
|
|
16
|
-
described_class.new(parent_class)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
describe '#self_included_modules' do
|
|
20
|
-
it do
|
|
21
|
-
expect(parent_class.self_included_modules).to include(includeable_module)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it do
|
|
25
|
-
expect(child_class.self_included_modules).not_to include(includeable_module)
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Class, '#static_method' do
|
|
4
|
-
let(:stub_method_class) do
|
|
5
|
-
described_class.new do
|
|
6
|
-
def self.name
|
|
7
|
-
'StubMethodClass'
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
enable_static_method_class
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
describe '#enable_static_method_class' do
|
|
15
|
-
it { expect(stub_method_class.included_modules).to include(EacRubyUtils::StaticMethodClass) }
|
|
16
|
-
end
|
|
17
|
-
end
|
data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerable/boolean_combinations_spec.rb
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Enumerable, '#boolean_combinations' do
|
|
4
|
-
let(:empty_instance) { [].to_enum }
|
|
5
|
-
let(:a_instance) { [:a].to_enum }
|
|
6
|
-
let(:ab_instance) { %i[a b].to_enum }
|
|
7
|
-
|
|
8
|
-
describe '#bool_hash_combs' do
|
|
9
|
-
it do
|
|
10
|
-
expect(empty_instance.bool_hash_combs).to eq([])
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it do
|
|
14
|
-
expect(a_instance.bool_hash_combs).to eq([{ a: false }, { a: true }])
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it do
|
|
18
|
-
expect(ab_instance.bool_hash_combs)
|
|
19
|
-
.to eq([{ a: false, b: false }, { a: false, b: true }, { a: true, b: false },
|
|
20
|
-
{ a: true, b: true }])
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
describe '#bool_array_combs' do
|
|
25
|
-
it do
|
|
26
|
-
expect(empty_instance.bool_array_combs).to eq([])
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it do
|
|
30
|
-
expect(a_instance.bool_array_combs).to eq([[], [:a]])
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it do
|
|
34
|
-
expect(ab_instance.bool_array_combs).to eq([[], [:a], [:b], %i[a b]])
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Enumerator, '#current' do
|
|
4
|
-
let(:list) { %w[a b] }
|
|
5
|
-
let(:instance) { list.each }
|
|
6
|
-
|
|
7
|
-
it { expect(instance).to be_a(described_class) }
|
|
8
|
-
it { expect(instance.current).to eq('a') }
|
|
9
|
-
|
|
10
|
-
context 'with first next' do
|
|
11
|
-
before { instance.next }
|
|
12
|
-
|
|
13
|
-
it { expect(instance.current).to eq('b') }
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
context 'with last next' do
|
|
17
|
-
before do
|
|
18
|
-
instance.next
|
|
19
|
-
instance.next
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it { expect(instance.current).to be_nil }
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Enumerator, '#stopped' do
|
|
4
|
-
let(:list) { %w[a b] }
|
|
5
|
-
let(:instance) { list.each }
|
|
6
|
-
|
|
7
|
-
it { expect(instance).to be_a(described_class) }
|
|
8
|
-
it { expect(instance.peek).to eq('a') }
|
|
9
|
-
it { expect(instance).to be_ongoing }
|
|
10
|
-
it { expect(instance).not_to be_stopped }
|
|
11
|
-
|
|
12
|
-
context 'with first next' do
|
|
13
|
-
before { instance.next }
|
|
14
|
-
|
|
15
|
-
it { expect(instance.peek).to eq('b') }
|
|
16
|
-
it { expect(instance).to be_ongoing }
|
|
17
|
-
it { expect(instance).not_to be_stopped }
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
context 'with last next' do
|
|
21
|
-
before do
|
|
22
|
-
instance.next
|
|
23
|
-
instance.next
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it { expect { instance.peek }.to raise_error(StopIteration) }
|
|
27
|
-
it { expect(instance).not_to be_ongoing }
|
|
28
|
-
it { expect(instance).to be_stopped }
|
|
29
|
-
end
|
|
30
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Hash, '#if_key' do
|
|
4
|
-
subject(:instance) { { a: 'a_value' } }
|
|
5
|
-
|
|
6
|
-
it do
|
|
7
|
-
expect(instance.if_key(:a)).to eq('a_value')
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
it do
|
|
11
|
-
expect(instance.if_key(:a) { |v| "_#{v}_" }).to eq('_a_value_')
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
it do
|
|
15
|
-
expect(instance.if_key(:b)).to be_nil
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it do
|
|
19
|
-
expect(instance.if_key(:b, 'default_value')).to eq('default_value')
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Hash, '#options_consumer' do
|
|
4
|
-
let(:a_hash) { { a: 'a_value', b: 'b_value', c: 'c_value' } }
|
|
5
|
-
let(:instance) { a_hash.to_options_consumer }
|
|
6
|
-
|
|
7
|
-
it 'returns a OptionsConsumer' do
|
|
8
|
-
expect(instance).to be_a(EacRubyUtils::OptionsConsumer)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it do
|
|
12
|
-
expect(instance.left_data).to eq({ a: 'a_value', b: 'b_value', c: 'c_value' }
|
|
13
|
-
.with_indifferent_access)
|
|
14
|
-
end
|
|
15
|
-
end
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Hash, '#sym_keys_hash' do
|
|
4
|
-
let(:a_hash) { { 'a' => 'a_value', 1 => '1_value', s: 's_value' } }
|
|
5
|
-
|
|
6
|
-
describe '#to_sym_keys_hash' do
|
|
7
|
-
it 'converts all keys to symbols' do
|
|
8
|
-
expect(a_hash.to_sym_keys_hash).to eq(a: 'a_value', '1': '1_value', s: 's_value')
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Integer, '#rjust_zero' do
|
|
4
|
-
[
|
|
5
|
-
[0, 1, '0'],
|
|
6
|
-
[9999, 2, '9999'],
|
|
7
|
-
[5, 2, '05'],
|
|
8
|
-
[123, 6, '000123']
|
|
9
|
-
].each do |sample|
|
|
10
|
-
instance, size, expected_value = sample # rubocop:disable RSpec/LeakyLocalVariable
|
|
11
|
-
|
|
12
|
-
context "when instance is #{instance} and size is #{size}" do
|
|
13
|
-
it do
|
|
14
|
-
expect(instance.rjust_zero(size)).to eq(expected_value)
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Module, '#compare_by' do
|
|
4
|
-
let(:klass) do
|
|
5
|
-
Class.new do
|
|
6
|
-
compare_by :field1, :field2
|
|
7
|
-
attr_reader :field1, :field2
|
|
8
|
-
|
|
9
|
-
def initialize(field1, field2)
|
|
10
|
-
@field1 = field1
|
|
11
|
-
@field2 = field2
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
let(:o1) { klass.new(1, 2) } # rubocop:disable RSpec/IndexedLet
|
|
16
|
-
let(:o2) { klass.new(2, 1) } # rubocop:disable RSpec/IndexedLet
|
|
17
|
-
let(:o3) { klass.new(1, 1) } # rubocop:disable RSpec/IndexedLet
|
|
18
|
-
|
|
19
|
-
describe '#comparable' do
|
|
20
|
-
it { expect(o1).to be < o2 }
|
|
21
|
-
it { expect(o1).to be > o3 }
|
|
22
|
-
it { expect(o2).to be > o3 }
|
|
23
|
-
it { expect([o1, o2, o3].sort).to eq([o3, o1, o2]) }
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
describe '#equality' do
|
|
27
|
-
it { expect(o1).not_to eq(o2) }
|
|
28
|
-
it { expect(o1).not_to eq(o3) }
|
|
29
|
-
it { expect(o2).not_to eq(o3) }
|
|
30
|
-
|
|
31
|
-
it { expect(o1).to eq(klass.new(1, 2)) }
|
|
32
|
-
it { expect(o2).to eq(klass.new(2, 1)) }
|
|
33
|
-
it { expect(o3).to eq(klass.new(1, 1)) }
|
|
34
|
-
end
|
|
35
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Module, '#listable' do
|
|
4
|
-
let(:stub_class) do
|
|
5
|
-
Class.new do
|
|
6
|
-
enable_listable
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
describe '#enable_listable' do
|
|
11
|
-
it { expect(stub_class.included_modules).to include(EacRubyUtils::Listable) }
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Module, '#simple_cache' do
|
|
4
|
-
let(:stub_class) do
|
|
5
|
-
Class.new do
|
|
6
|
-
enable_simple_cache
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
describe '#enable_simple_cache' do
|
|
11
|
-
it { expect(stub_class.included_modules).to include(EacRubyUtils::SimpleCache) }
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Module, '#speaker' do
|
|
4
|
-
let(:stub_class) do
|
|
5
|
-
Class.new do
|
|
6
|
-
enable_speaker
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
describe '#enable_speaker' do
|
|
11
|
-
it { expect(stub_class.included_modules).to include(EacRubyUtils::Speaker::Sender) }
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Object, '#call_if_proc' do
|
|
4
|
-
describe '#call_if_proc' do
|
|
5
|
-
it { expect(nil.call_if_proc).to be_nil }
|
|
6
|
-
it { expect('a string'.call_if_proc).to eq('a string') }
|
|
7
|
-
it { expect(-> { 'a returned value' }.call_if_proc).to eq('a returned value') }
|
|
8
|
-
end
|
|
9
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Object, '#compact' do
|
|
4
|
-
let(:instance) { Struct.new(:a_attr, :b_attr).new('a_value', 'b_value') }
|
|
5
|
-
let(:attributes) { %w[a_attr b_attr] }
|
|
6
|
-
|
|
7
|
-
describe '#compact_to_a' do
|
|
8
|
-
it do
|
|
9
|
-
expect(instance.compact_to_a(*attributes)).to eq(%w[a_value b_value])
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
describe '#compact_to_h' do
|
|
14
|
-
it do
|
|
15
|
-
expect(instance.compact_to_h(*attributes)).to eq(a_attr: 'a_value', b_attr: 'b_value')
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe Object, '#if_present' do
|
|
4
|
-
describe '#if_present' do
|
|
5
|
-
it { expect(nil.if_present).to be_nil }
|
|
6
|
-
it { expect(nil.if_present('default')).to eq('default') }
|
|
7
|
-
it { expect(nil.if_present('default') { |_v| 'calculated' }).to eq('default') }
|
|
8
|
-
it { expect('present'.if_present('default')).to eq('present') }
|
|
9
|
-
it { expect('present'.if_present { |v| "#{v}_calculated" }).to eq('present_calculated') }
|
|
10
|
-
end
|
|
11
|
-
end
|