eac_tools 0.2.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +42 -30
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/lib/avm/sources/base/configuration.rb +14 -6
- data/sub/avm/lib/avm/sources/base/testing.rb +50 -7
- data/sub/avm/lib/avm/sources/tests/builder.rb +8 -1
- data/sub/avm/lib/avm/sources/tests/single.rb +28 -9
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_generic_base0/Gemfile +3 -0
- data/sub/avm-eac_generic_base0/avm-eac_generic_base0.gemspec +3 -3
- data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base.rb +0 -6
- data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/version.rb +1 -1
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/Gemfile +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/avm-eac_rails_base0.gemspec +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/lib/avm/eac_rails_base0/apache_host.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/lib/avm/eac_rails_base0/apache_path.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/lib/avm/eac_rails_base0/deploy.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/lib/avm/eac_rails_base0/instance.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/lib/avm/eac_rails_base0/runners/base.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/lib/avm/eac_rails_base0/runners.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/lib/avm/eac_rails_base0/sources/base.rb +14 -1
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/lib/avm/eac_rails_base0/version.rb +1 -1
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/lib/avm/eac_rails_base0.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/spec/lib/avm/eac_rails_base0/apache_host_spec.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/spec/lib/avm/eac_rails_base0/apache_host_spec_files/apache_host_spec_no_ssl_content.conf +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/spec/lib/avm/eac_rails_base0/apache_path_spec.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/spec/lib/avm/eac_rails_base0/apache_path_spec_files/stub-app_0_apache_path.conf +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/spec/rubocop_spec.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/spec/spec_helper.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/template/avm/eac_rails_base0/apache_path/extra_content.conf +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/template/avm/eac_rails_base0/deploy/config/database.yml.template +0 -0
- data/sub/{avm-tools/sub/avm-eac_rails_base0 → avm-eac_rails_base0}/template/avm/eac_rails_base0/deploy/config/envvars.d/email.yml.template +0 -0
- data/sub/avm-eac_rails_base1/Gemfile +3 -0
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +2 -2
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/sources/base.rb +16 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/deploy/config/install.sh.template +4 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +15 -7
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- data/sub/avm-tools/Gemfile.lock +24 -28
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- data/sub/eac_ruby_utils/Gemfile +16 -0
- data/sub/eac_ruby_utils/MIT-LICENCE +16 -0
- data/sub/eac_ruby_utils/README.rdoc +3 -0
- data/sub/eac_ruby_utils/eac_ruby_utils.gemspec +24 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/abstract_methods.rb +68 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/arguments_consumer.rb +81 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/bit.rb +46 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/bit_array.rb +81 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/blank_not_blank.rb +19 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb +31 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/by_reference.rb +23 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/byte.rb +105 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/byte_array.rb +36 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_concern/class_setup.rb +52 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_concern/module_setup.rb +41 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb +20 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb +29 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/instance_initialize.rb +53 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/super_args.rb +54 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +89 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/compact.rb +22 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/compare_by.rb +28 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/context.rb +33 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/contextualizable.rb +21 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/core_ext.rb +7 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/custom_format.rb +53 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/enum.rb +102 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_env.rb +28 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/concat.rb +33 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb +24 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/extra_options.rb +33 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +172 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +81 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/file.rb +22 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/local_env.rb +17 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb +27 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/spawn.rb +32 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/dasho_options.rb +53 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/identity_file.rb +25 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/quiet.rb +24 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/terminal.rb +34 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env.rb +75 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs.rb +23 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/clearable_directory.rb +57 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/extname.rb +30 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/temp/directory.rb +16 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/temp/file.rb +34 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/temp.rb +52 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +79 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +35 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/array_accessor.rb +32 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/base_accessor.rb +23 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/boolean_accessor.rb +16 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb +20 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/common_accessor.rb +30 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/hash_accessor.rb +46 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/instance_methods.rb +21 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable.rb +15 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +29 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/class_methods.rb +14 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/instance_methods.rb +30 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb +23 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +111 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/lists.rb +59 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/string_list.rb +19 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/symbol_list.rb +19 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +49 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable.rb +17 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +48 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/from_all_gems.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/from_gem.rb +47 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/module_i18n_translate.rb +74 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/method_class.rb +35 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/options_consumer.rb +62 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patch.rb +11 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/abstract.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/common_constructor.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/self_included_modules.rb +7 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/settings_provider.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerable/boolean_combinations.rb +45 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerable.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/stopped.rb +14 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/options_consumer.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/sym_keys_hash.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/to_struct.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash.rb +5 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/common_concern.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/compare_by.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/context.rb +11 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/i18n_translate.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/immutable.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/listable.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/method_class.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/patch.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/require_sub.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/simple_cache.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/speaker.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/asserts.rb +25 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/call_if_proc.rb +11 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/compact.rb +20 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +23 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/i18n_translate.rb +13 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_nil.rb +17 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_present.rb +19 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_respond.rb +22 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/to_pathname.rb +15 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/to_uri.rb +15 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object.rb +5 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_noext.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/if_exist.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/mkpath_s.rb +12 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb +11 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/readlink_r.rb +11 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/reqdir_glob.rb +13 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/if_match.rb +16 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/to_parser.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/string/delimited.rb +16 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +11 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/string.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/time/required_zone.rb +11 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/time.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/recursive_builder.rb +51 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +34 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +134 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +20 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/conditionals.rb +17 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +12 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup_manager.rb +49 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/stub_speaker.rb +39 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb +32 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_clean_environment.rb +38 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/settings_provider/setting_value.rb +69 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +46 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +77 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker/receiver.rb +64 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker/sender.rb +32 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker.rb +16 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/string_delimited.rb +70 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/struct.rb +63 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +5 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +105 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils.rb +6 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb +28 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/arguments_consumer_spec.rb +17 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/bit_array_spec.rb +22 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/blank_not_blank_spec.rb +16 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/byte_spec.rb +54 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb +65 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +125 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/compact_spec.rb +20 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/compare_by_spec.rb +38 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/custom_format_spec.rb +60 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/enum_spec.rb +43 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/executable_spec.rb +37 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/ssh_env_spec.rb +25 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/extname_spec.rb +18 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/directory_spec.rb +12 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb +52 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb +16 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb +275 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/local_time_zone_spec.rb +17 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/method_class_spec.rb +46 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb +80 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/abstract_spec.rb +25 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/self_included_modules_spec.rb +30 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerable/boolean_combinations_spec.rb +39 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb +26 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/stopped_spec.rb +32 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/options_consumer_spec.rb +17 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/sym_keys_hash_spec.rb +13 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/compare_by_spec.rb +36 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/listable_spec.rb +15 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/method_class_spec.rb +20 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/simple_cache_spec.rb +15 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/speaker_spec.rb +13 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/call_if_proc_spec.rb +11 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/compact_spec.rb +20 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/if_present_spec.rb +13 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/template_spec_files/path/my_stub_with_template +1 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb +26 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_sub_spec.rb +17 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/parent_n_spec.rb +33 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb +34 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb +65 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec/stubbed_module_a.rb +6 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec/stubbed_not_module.rb +6 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec.rb +19 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby_spec.rb +22 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +57 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +129 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/struct_spec.rb +57 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/yaml_spec.rb +75 -0
- data/sub/eac_ruby_utils/spec/locales/pt-BR.yml +58 -0
- data/sub/eac_ruby_utils/spec/rubocop_check_spec.rb +3 -0
- data/sub/eac_ruby_utils/spec/spec_helper.rb +15 -0
- metadata +255 -52
- data/sub/avm/lib/avm/sources/tester.rb +0 -24
- data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/tester.rb +0 -56
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +0 -36
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/settings_provider'
|
4
|
+
|
5
|
+
RSpec.describe ::EacRubyUtils::SettingsProvider do
|
6
|
+
let(:stub_class) do
|
7
|
+
the_described_class = described_class
|
8
|
+
r = ::Class.new do
|
9
|
+
include the_described_class
|
10
|
+
|
11
|
+
def key_a
|
12
|
+
'method_a'
|
13
|
+
end
|
14
|
+
|
15
|
+
def key_b
|
16
|
+
'method_b'
|
17
|
+
end
|
18
|
+
|
19
|
+
def settings
|
20
|
+
{ 'key_b' => 'setting_b', key_c: 'setting_c' }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
r.const_set(:KEY_A, 'constant_a')
|
24
|
+
r.const_set(:KEY_D, 'constant_d')
|
25
|
+
r
|
26
|
+
end
|
27
|
+
|
28
|
+
let(:stub) { stub_class.new }
|
29
|
+
|
30
|
+
describe '#setting_value' do
|
31
|
+
{
|
32
|
+
['key_a'] => 'method_a',
|
33
|
+
[:key_b] => 'setting_b',
|
34
|
+
['key_b', { order: %w[constant method settings_object] }] => 'method_b',
|
35
|
+
['key_c'] => 'setting_c',
|
36
|
+
['key_d'] => 'constant_d'
|
37
|
+
}.each do |args, expected_value|
|
38
|
+
it { expect(stub.setting_value(*args)).to eq(expected_value) }
|
39
|
+
end
|
40
|
+
|
41
|
+
it do
|
42
|
+
expect { stub.setting_value('key_e') }.to raise_error(::StandardError)
|
43
|
+
end
|
44
|
+
|
45
|
+
it do
|
46
|
+
expect(stub.setting_value('key_e', required: false)).to eq(nil)
|
47
|
+
end
|
48
|
+
|
49
|
+
it do
|
50
|
+
expect(stub.setting_value('key_e', default: nil)).to eq(nil)
|
51
|
+
end
|
52
|
+
|
53
|
+
it do
|
54
|
+
expect(stub.setting_value('key_e', default: 'default_e')).to eq('default_e')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/simple_cache'
|
4
|
+
|
5
|
+
class CacheableObject
|
6
|
+
include ::EacRubyUtils::SimpleCache
|
7
|
+
|
8
|
+
def my_method_uncached
|
9
|
+
@counter ||= 0
|
10
|
+
@counter += 1
|
11
|
+
end
|
12
|
+
|
13
|
+
def method_with_question_uncached?
|
14
|
+
'question'
|
15
|
+
end
|
16
|
+
|
17
|
+
def method_with_exclamation_uncached!
|
18
|
+
'exclamation'
|
19
|
+
end
|
20
|
+
|
21
|
+
def method_with_args_uncached(arg1)
|
22
|
+
@counter2 ||= 0
|
23
|
+
@counter2 += 1
|
24
|
+
"#{arg1}/#{@counter2}"
|
25
|
+
end
|
26
|
+
|
27
|
+
def method_with_reset_uncached
|
28
|
+
reset_cache
|
29
|
+
'result'
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def private_method_uncached
|
35
|
+
@counter3 ||= 0
|
36
|
+
@counter3 += 1
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
RSpec.describe ::EacRubyUtils::SimpleCache do
|
41
|
+
let(:instance) { CacheableObject.new }
|
42
|
+
|
43
|
+
describe 'cached value' do
|
44
|
+
it 'uncached method return value should update at each call' do
|
45
|
+
expect(instance.my_method_uncached).not_to eq(instance.my_method_uncached)
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'cached method should return same values at each call' do
|
49
|
+
expect(instance.my_method).to eq(instance.my_method)
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'is able to call private uncached as cached' do
|
53
|
+
expect(instance.private_method).to eq(instance.private_method)
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'return value even if reset cache' do
|
57
|
+
expect(instance.method_with_reset).to eq('result')
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe 'cache value with args' do
|
62
|
+
it do
|
63
|
+
expect(instance.method_with_args_uncached('123'))
|
64
|
+
.not_to eq(instance.method_with_args_uncached('123'))
|
65
|
+
end
|
66
|
+
|
67
|
+
it do
|
68
|
+
expect(instance.method_with_args_uncached('456'))
|
69
|
+
.not_to eq(instance.method_with_args_uncached('456'))
|
70
|
+
end
|
71
|
+
|
72
|
+
it do
|
73
|
+
expect(instance.method_with_args('123')).to eq(instance.method_with_args('123'))
|
74
|
+
end
|
75
|
+
|
76
|
+
it do
|
77
|
+
expect(instance.method_with_args('456')).to eq(instance.method_with_args('456'))
|
78
|
+
end
|
79
|
+
|
80
|
+
it do
|
81
|
+
expect(instance.method_with_args('456')).not_to eq(instance.method_with_args('123'))
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
describe 'method with marks' do
|
86
|
+
it 'found uncached method with exclamation mark' do
|
87
|
+
expect(instance.method_with_exclamation!).to eq('exclamation')
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'found uncached method with question mark' do
|
91
|
+
expect(instance.method_with_question?).to eq('question')
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
describe '#respond_to?' do
|
96
|
+
it 'responds to cached method without args' do
|
97
|
+
expect(instance.respond_to?(:my_method)).to be(true)
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'responds to cached method with args' do
|
101
|
+
expect(instance.respond_to?(:method_with_args)).to be(true)
|
102
|
+
end
|
103
|
+
|
104
|
+
it 'responds to cached method of uncached private method' do
|
105
|
+
expect(instance.respond_to?(:private_method)).to be(true)
|
106
|
+
end
|
107
|
+
|
108
|
+
it 'not respond to not existent method' do
|
109
|
+
expect(instance.respond_to?(:not_exist)).to be(false)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
describe '#reset_cache' do
|
114
|
+
let(:instance) { CacheableObject.new }
|
115
|
+
let(:cached_value) { instance.my_method }
|
116
|
+
|
117
|
+
it 'cached method return should return cached value' do
|
118
|
+
expect(instance.my_method).to eq(cached_value)
|
119
|
+
end
|
120
|
+
|
121
|
+
context 'when reset_cache method is called' do
|
122
|
+
it 'cached method return should return new cached value' do
|
123
|
+
cached_value
|
124
|
+
instance.reset_cache
|
125
|
+
expect(instance.my_method).not_to eq(cached_value)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/struct'
|
4
|
+
|
5
|
+
RSpec.describe ::EacRubyUtils::Struct do
|
6
|
+
let(:instance) { described_class.new('a' => 1, b: '') }
|
7
|
+
let(:other) { described_class.new('a' => 'm1', c: 'm2') }
|
8
|
+
|
9
|
+
describe '#[]' do
|
10
|
+
it { expect(instance[:a]).to eq(1) }
|
11
|
+
it { expect(instance['a']).to eq(1) }
|
12
|
+
it { expect(instance[:a?]).to eq(true) }
|
13
|
+
it { expect(instance['a?']).to eq(true) }
|
14
|
+
it { expect(instance[:b]).to eq('') }
|
15
|
+
it { expect(instance['b']).to eq('') }
|
16
|
+
it { expect(instance[:b?]).to eq(false) }
|
17
|
+
it { expect(instance['b?']).to eq(false) }
|
18
|
+
it { expect(instance[:c]).to eq(nil) }
|
19
|
+
it { expect(instance['c']).to eq(nil) }
|
20
|
+
it { expect(instance[:c?]).to eq(false) }
|
21
|
+
it { expect(instance['c?']).to eq(false) }
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#fetch' do
|
25
|
+
it { expect(instance.fetch(:a)).to eq(1) }
|
26
|
+
it { expect(instance.fetch('a')).to eq(1) }
|
27
|
+
it { expect(instance.fetch(:a?)).to eq(true) }
|
28
|
+
it { expect(instance.fetch('a?')).to eq(true) }
|
29
|
+
it { expect(instance.fetch(:b)).to eq('') }
|
30
|
+
it { expect(instance.fetch('b')).to eq('') }
|
31
|
+
it { expect(instance.fetch(:b?)).to eq(false) }
|
32
|
+
it { expect(instance.fetch('b?')).to eq(false) }
|
33
|
+
it { expect { instance.fetch(:c) }.to raise_error(::KeyError) }
|
34
|
+
it { expect { instance.fetch('c') }.to raise_error(::KeyError) }
|
35
|
+
it { expect { instance.fetch(:c?) }.to raise_error(::KeyError) }
|
36
|
+
it { expect { instance.fetch('c?') }.to raise_error(::KeyError) }
|
37
|
+
end
|
38
|
+
|
39
|
+
describe '#merge' do
|
40
|
+
let(:merged) { instance.merge(other) }
|
41
|
+
|
42
|
+
it { expect(merged.to_h).to eq(a: 'm1', b: '', c: 'm2') }
|
43
|
+
end
|
44
|
+
|
45
|
+
describe '#property_method' do
|
46
|
+
it { expect(instance.a).to eq(1) }
|
47
|
+
it { expect(instance.a?).to eq(true) }
|
48
|
+
it { expect(instance.b).to eq('') }
|
49
|
+
it { expect(instance.b?).to eq(false) }
|
50
|
+
it { expect { instance.c }.to raise_error(::NoMethodError) }
|
51
|
+
it { expect { instance.c? }.to raise_error(::NoMethodError) }
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#to_h' do
|
55
|
+
it { expect(instance.to_h).to eq(a: 1, b: '') }
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/hash_with_indifferent_access'
|
4
|
+
require 'eac_ruby_utils/yaml'
|
5
|
+
|
6
|
+
RSpec.describe ::EacRubyUtils::Yaml do
|
7
|
+
let(:unpermitted_class) do
|
8
|
+
Class.new do
|
9
|
+
def initialize(value)
|
10
|
+
@value = value
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_s
|
14
|
+
@value.to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
let(:arrayliable_class) do
|
20
|
+
Class.new do
|
21
|
+
def initialize(value)
|
22
|
+
@value = value
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_a
|
26
|
+
[@value]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
let(:source) do
|
32
|
+
{
|
33
|
+
a: 'a', b: :b, c: false, d: true, e: nil,
|
34
|
+
f: [
|
35
|
+
'f',
|
36
|
+
{
|
37
|
+
g: 'g',
|
38
|
+
h: ::ActiveSupport::HashWithIndifferentAccess.new(
|
39
|
+
'i' => ['i', unpermitted_class.new('j')],
|
40
|
+
k: arrayliable_class.new('k')
|
41
|
+
)
|
42
|
+
}
|
43
|
+
]
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
let(:target) do
|
48
|
+
{
|
49
|
+
a: 'a', b: :b, c: false, d: true, e: nil,
|
50
|
+
f: ['f', { g: 'g', h: { i: %w[i j], k: ['k'] } }]
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#dump' do
|
55
|
+
it { expect(described_class.load(described_class.dump(source))).to eq(target) }
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#sanitize' do
|
59
|
+
it { expect(described_class.sanitize(target)).to eq(target) }
|
60
|
+
end
|
61
|
+
|
62
|
+
describe '#yaml' do
|
63
|
+
{
|
64
|
+
['text'] => false,
|
65
|
+
'text' => false,
|
66
|
+
"--- Text\n\n" => true,
|
67
|
+
"---\n" + ":index: 0\n" + ":codec_name: h264\n" + ":codec_type: video\n" => true,
|
68
|
+
'--- - \n bla bla bla' => false
|
69
|
+
}.each do |source, result|
|
70
|
+
it "return #{result} to source \"#{source}\"" do
|
71
|
+
expect(described_class.yaml?(source)).to eq(result)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
pt-BR:
|
2
|
+
eac_ruby_utils:
|
3
|
+
listable:
|
4
|
+
stub:
|
5
|
+
inteiro:
|
6
|
+
a:
|
7
|
+
label: Inteiro A
|
8
|
+
description: Inteiro A Descr.
|
9
|
+
b:
|
10
|
+
label: Inteiro BB
|
11
|
+
description: Inteiro BB Descr.
|
12
|
+
c:
|
13
|
+
label: Inteiro CCC
|
14
|
+
description: Inteiro CCC Descr.
|
15
|
+
__blank:
|
16
|
+
label: Inteiro em branco
|
17
|
+
description: Inteiro em branco Descr.
|
18
|
+
cadeia:
|
19
|
+
a:
|
20
|
+
label: Cadeia AAA
|
21
|
+
description: Cadeia AAA Descr.
|
22
|
+
b:
|
23
|
+
label: Cadeia BB
|
24
|
+
description: Cadeia BB Descr.
|
25
|
+
c:
|
26
|
+
label: Cadeia C
|
27
|
+
description: Cadeia C Descr.
|
28
|
+
code:
|
29
|
+
a:
|
30
|
+
label: Código A
|
31
|
+
description: Código A Descr.
|
32
|
+
b:
|
33
|
+
label: Código B
|
34
|
+
description: Código B Descr.
|
35
|
+
type:
|
36
|
+
a:
|
37
|
+
label: Tipo A
|
38
|
+
description: Tipo A Descr.
|
39
|
+
b:
|
40
|
+
label: Tipo B
|
41
|
+
description: Tipo B Descr.
|
42
|
+
simbolo:
|
43
|
+
a:
|
44
|
+
label: Simbolo A
|
45
|
+
description: Simbolo A Descr.
|
46
|
+
b:
|
47
|
+
label: Simbolo B
|
48
|
+
description: Simbolo B Descr.
|
49
|
+
c:
|
50
|
+
label: Simbolo C
|
51
|
+
description: Simbolo C Descr.
|
52
|
+
tipado:
|
53
|
+
a:
|
54
|
+
label: Tipado A
|
55
|
+
description: Tipado A Descr.
|
56
|
+
b:
|
57
|
+
label: Tipado B
|
58
|
+
description: Tipado B Descr.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path('../lib', __dir__)
|
4
|
+
require 'tmpdir'
|
5
|
+
|
6
|
+
require 'i18n'
|
7
|
+
::I18n.load_path << ::File.join(__dir__, 'locales/pt-BR.yml')
|
8
|
+
::I18n.locale = 'pt-BR'
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
config.example_status_persistence_file_path = ::File.join(::Dir.tmpdir, 'eac_ruby_utils_rspec')
|
12
|
+
|
13
|
+
require 'eac_ruby_utils/rspec/default_setup'
|
14
|
+
::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__), config)
|
15
|
+
end
|