eac_tools 0.97.1 → 0.97.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +30 -25
- data/lib/eac_tools/version.rb +1 -1
- data/sub/eac_config/eac_config.gemspec +20 -0
- data/sub/eac_config/lib/eac_config/entries.rb +35 -0
- data/sub/eac_config/lib/eac_config/entry/not_found_error.rb +13 -0
- data/sub/eac_config/lib/eac_config/entry.rb +64 -0
- data/sub/eac_config/lib/eac_config/entry_path.rb +89 -0
- data/sub/eac_config/lib/eac_config/envvars_node/entry.rb +54 -0
- data/sub/eac_config/lib/eac_config/envvars_node.rb +35 -0
- data/sub/eac_config/lib/eac_config/load_nodes_search.rb +39 -0
- data/sub/eac_config/lib/eac_config/load_path.rb +28 -0
- data/sub/eac_config/lib/eac_config/node.rb +81 -0
- data/sub/eac_config/lib/eac_config/node_entry.rb +28 -0
- data/sub/eac_config/lib/eac_config/node_uri/instanciate_single.rb +29 -0
- data/sub/eac_config/lib/eac_config/node_uri.rb +45 -0
- data/sub/eac_config/lib/eac_config/old_configs/base.rb +43 -0
- data/sub/eac_config/lib/eac_config/old_configs/file.rb +47 -0
- data/sub/eac_config/lib/eac_config/old_configs.rb +75 -0
- data/sub/eac_config/lib/eac_config/paths_hash/entry_key_error.rb +8 -0
- data/sub/eac_config/lib/eac_config/paths_hash/node.rb +67 -0
- data/sub/eac_config/lib/eac_config/paths_hash/path_search.rb +39 -0
- data/sub/eac_config/lib/eac_config/paths_hash.rb +63 -0
- data/sub/eac_config/lib/eac_config/prefixed_path_node/entry.rb +25 -0
- data/sub/eac_config/lib/eac_config/prefixed_path_node.rb +19 -0
- data/sub/eac_config/lib/eac_config/rspec/setup.rb +65 -0
- data/sub/{avm-eac_rails_base1/lib/avm/eac_rails_base1.rb → eac_config/lib/eac_config/rspec.rb} +2 -2
- data/sub/eac_config/lib/eac_config/version.rb +5 -0
- data/sub/eac_config/lib/eac_config/yaml_file_node/entry.rb +36 -0
- data/sub/eac_config/lib/eac_config/yaml_file_node/self_entries.rb +72 -0
- data/sub/eac_config/lib/eac_config/yaml_file_node.rb +54 -0
- data/sub/eac_config/lib/eac_config.rb +7 -0
- data/sub/eac_config/spec/lib/eac_config/entry_path_spec.rb +30 -0
- data/sub/eac_config/spec/lib/eac_config/envvars_node/entry_spec.rb +14 -0
- data/sub/eac_config/spec/lib/eac_config/envvars_node_spec.rb +51 -0
- data/sub/eac_config/spec/lib/eac_config/old_configs_spec.rb +46 -0
- data/sub/eac_config/spec/lib/eac_config/paths_hash_spec.rb +63 -0
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec.rb +88 -0
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1.yaml +10 -0
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_1.yaml +4 -0
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2/storage1_2_1.yaml +4 -0
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2.yaml +10 -0
- data/sub/eac_ruby_utils/Gemfile +8 -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 +26 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_abstract.rb +100 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/array_accessor.rb +25 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/base_accessor.rb +57 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/boolean_accessor.rb +16 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/class_methods.rb +20 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/common_accessor.rb +30 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/enumerable_accessor.rb +52 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/hash_accessor.rb +57 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/instance_methods.rb +21 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable/set_accessor.rb +25 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_immutable.rb +15 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_instance_method.rb +34 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/arguments_consumer.rb +80 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/bit.rb +47 -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 +106 -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_accessors.rb +36 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb +39 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/instance_initialize.rb +64 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/super_args.rb +55 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +93 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/compact.rb +32 -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/enumerables_methods.rb +42 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/append_command_options.rb +38 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb +41 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/debugging.rb +19 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/execution.rb +52 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/extra_options.rb +28 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command.rb +45 -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/envvars.rb +27 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/extra_options.rb +23 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +67 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/composite_command.rb +45 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +93 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/execution_error.rb +8 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/execution_result.rb +45 -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 +74 -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 +80 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +34 -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/item.rb +48 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +129 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/lists.rb +51 -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.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 +30 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/module_ancestors_variable/base.rb +34 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/module_ancestors_variable/hash.rb +20 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/module_ancestors_variable/set.rb +19 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/module_ancestors_variable.rb +9 -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/addressable/uri/query_value.rb +37 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/addressable/uri.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/addressable.rb +4 -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/method_class.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/static_method_class.rb +9 -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/if_key.rb +12 -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/ibr.rb +10 -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/acts_as_abstract.rb +14 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/acts_as_immutable.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/acts_as_instance_method.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 +11 -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/module_parent.rb +5 -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 +55 -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/recursive_build.rb +12 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/to_bool.rb +12 -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_sym_by_eac.rb +11 -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/assert_parent.rb +12 -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 +13 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/child_of.rb +16 -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 +39 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub/base.rb +80 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub/sub_file.rb +59 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +11 -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/setup_manager.rb +17 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +27 -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 +71 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_replace_objects/replace_instance_method.rb +36 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_replace_objects.rb +52 -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 +79 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +50 -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 +37 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker.rb +16 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/static_method_class.rb +12 -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/unimplemented_method_error.rb +6 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +5 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/wildcards.rb +26 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +107 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils.rb +6 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/acts_as_abstract_spec.rb +94 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/acts_as_immutable/array_accessor_spec.rb +43 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/acts_as_immutable/common_accessor_spec.rb +57 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/acts_as_immutable/hash_accessor_spec.rb +42 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/acts_as_immutable/set_accessor_spec.rb +43 -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 +151 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/compact_spec.rb +21 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/compare_by_spec.rb +39 -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 +44 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/enumerables_methods_spec.rb +50 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/command/base_example.rb +97 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/command/local_env_spec.rb +11 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/command/ssh_env_spec.rb +17 -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 +225 -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/module_ancestors_variable/hash_spec.rb +57 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/module_ancestors_variable/set_spec.rb +57 -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/addressable/uri/query_value_spec.rb +25 -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/acts_as_abstract_spec.rb +14 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/method_class_spec.rb +20 -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/class/static_method_class_spec.rb +20 -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/if_key_spec.rb +23 -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 +37 -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/simple_cache_spec.rb +15 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/speaker_spec.rb +15 -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/recursive_build_spec.rb +62 -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/assert_parent_spec.rb +21 -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/child_of_spec.rb +26 -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/base_spec/stubbed_module_a.rb +6 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub/base_spec/stubbed_not_module.rb +6 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub/base_spec.rb +19 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/rspec/setup/setup_manager_spec.rb +17 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb +31 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_replace_objects_spec.rb +65 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +64 -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/static_method_class_spec.rb +44 -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/wildcards_spec.rb +27 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/yaml_spec.rb +76 -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 +317 -37
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +0 -22
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/apache_base.rb +0 -16
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/apache_host.rb +0 -18
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/apache_path.rb +0 -21
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb +0 -50
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/deploy.rb +0 -23
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes/daemon.rb +0 -39
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes/tasks_scheduler.rb +0 -27
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes.rb +0 -13
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/bundle.rb +0 -28
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/code_runner.rb +0 -28
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/log.rb +0 -45
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/logs/clear.rb +0 -27
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/logs.rb +0 -19
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/rails_server.rb +0 -34
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/tasks_scheduler/systemd_unit.rb +0 -48
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/tasks_scheduler.rb +0 -19
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners.rb +0 -13
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/systemd_unit/service.rb +0 -72
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/systemd_unit/tasks_scheduler_command.rb +0 -31
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/systemd_unit.rb +0 -59
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances.rb +0 -11
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +0 -27
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +0 -47
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/sources/base.rb +0 -43
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +0 -7
- data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/instances/apache_path/extra_content.conf +0 -5
- data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/instances/systemd_unit/tasks_scheduler.service +0 -12
- data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/instances/systemd_unit/tasks_scheduler_command.sh +0 -6
- /data/sub/{avm-eac_rails_base1 → eac_config}/Gemfile +0 -0
- /data/sub/{avm-eac_rails_base1 → eac_config}/spec/rubocop_spec.rb +0 -0
- /data/sub/{avm-eac_rails_base1 → eac_config}/spec/spec_helper.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 100674b2b84fad4d62d2071a22db9723492c6966038794b1a9cd3160849d89e0
|
4
|
+
data.tar.gz: a1872d982a0df4f9b3fffc8f7ee75f5269d7afa0c6e67e7f2aad3316fe482973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96d68091e4e96925ebcd835f9f7cad9175e1d56e713df2457fe7b090256de9efbb1a67538dd6974758c04d20830a74eccff4b61dac1b1e46630ce2d0785c4367
|
7
|
+
data.tar.gz: ee73917df41a40ccc988fca28acf837b327cfff995a73c17feed66852c3230171a8349df3e7de01c1638732ad43acbd76cc5aefd3fa461346a265ab79c1d6787
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eac_tools (0.97.
|
4
|
+
eac_tools (0.97.2)
|
5
5
|
avm (~> 0.94)
|
6
6
|
avm-eac_asciidoctor_base0 (~> 0.25)
|
7
7
|
avm-eac_generic_base0 (~> 0.13)
|
@@ -21,16 +21,24 @@ PATH
|
|
21
21
|
avm-eac_wordpress_base0 (~> 0.3, >= 0.3.2)
|
22
22
|
avm-git (~> 0.18)
|
23
23
|
avm-tools (~> 0.162)
|
24
|
-
eac_ruby_utils (~> 0.
|
24
|
+
eac_ruby_utils (~> 0.124)
|
25
25
|
|
26
26
|
PATH
|
27
|
-
remote: sub/
|
27
|
+
remote: sub/eac_config
|
28
28
|
specs:
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
eac_config (0.14.3)
|
30
|
+
addressable (~> 2.8, >= 2.8.7)
|
31
|
+
eac_ruby_utils (~> 0.124)
|
32
|
+
|
33
|
+
PATH
|
34
|
+
remote: sub/eac_ruby_utils
|
35
|
+
specs:
|
36
|
+
eac_ruby_utils (0.124.0)
|
37
|
+
activesupport (>= 4, < 7)
|
38
|
+
addressable (~> 2.8, >= 2.8.7)
|
39
|
+
bundler
|
40
|
+
filesize (~> 0.2)
|
41
|
+
net-ssh (~> 4.2)
|
34
42
|
|
35
43
|
GEM
|
36
44
|
remote: https://rubygems.org/
|
@@ -89,6 +97,11 @@ GEM
|
|
89
97
|
avm-eac_rails_base0 (0.11.1)
|
90
98
|
avm-eac_rails_base1 (~> 0.10)
|
91
99
|
eac_ruby_utils (~> 0.121)
|
100
|
+
avm-eac_rails_base1 (0.10.2)
|
101
|
+
avm (~> 0.94)
|
102
|
+
avm-eac_ruby_base1 (~> 0.35, >= 0.35.1)
|
103
|
+
avm-eac_webapp_base0 (~> 0.20, >= 0.20.1)
|
104
|
+
eac_ruby_utils (~> 0.123)
|
92
105
|
avm-eac_redmine_base0 (0.22.3)
|
93
106
|
avm (~> 0.92)
|
94
107
|
avm-eac_generic_base0 (~> 0.13)
|
@@ -154,9 +167,6 @@ GEM
|
|
154
167
|
eac_config (~> 0.14, >= 0.14.2)
|
155
168
|
eac_ruby_utils (~> 0.122)
|
156
169
|
tty-table (~> 0.12)
|
157
|
-
eac_config (0.14.2)
|
158
|
-
addressable (~> 2.8, >= 2.8.6)
|
159
|
-
eac_ruby_utils (~> 0.121)
|
160
170
|
eac_docker (0.7.0)
|
161
171
|
eac_ruby_utils (~> 0.112)
|
162
172
|
eac_templates (~> 0.3, >= 0.3.2)
|
@@ -191,12 +201,6 @@ GEM
|
|
191
201
|
rubocop (~> 1.60, >= 1.60.1)
|
192
202
|
rubocop-rails (~> 2.23, >= 2.23.1)
|
193
203
|
rubocop-rspec (~> 2.26, >= 2.26.1)
|
194
|
-
eac_ruby_utils (0.123.0)
|
195
|
-
activesupport (>= 4, < 7)
|
196
|
-
addressable (~> 2.8, >= 2.8.7)
|
197
|
-
bundler
|
198
|
-
filesize (~> 0.2)
|
199
|
-
net-ssh (~> 4.2)
|
200
204
|
eac_templates (0.7.1)
|
201
205
|
eac_config (~> 0.14, >= 0.14.2)
|
202
206
|
eac_ruby_utils (~> 0.122)
|
@@ -221,16 +225,16 @@ GEM
|
|
221
225
|
htmlbeautifier (1.4.3)
|
222
226
|
i18n (1.14.6)
|
223
227
|
concurrent-ruby (~> 1.0)
|
224
|
-
json (2.
|
228
|
+
json (2.8.2)
|
225
229
|
language_server-protocol (3.17.0.3)
|
226
230
|
minitar (0.12.1)
|
227
|
-
minitest (5.25.
|
231
|
+
minitest (5.25.2)
|
228
232
|
multipart-post (2.4.1)
|
229
233
|
net-ssh (4.2.0)
|
230
234
|
os (1.1.4)
|
231
235
|
parallel (1.26.3)
|
232
236
|
parseconfig (1.1.2)
|
233
|
-
parser (3.3.
|
237
|
+
parser (3.3.6.0)
|
234
238
|
ast (~> 2.4.1)
|
235
239
|
racc
|
236
240
|
parslet (2.0.0)
|
@@ -257,17 +261,17 @@ GEM
|
|
257
261
|
diff-lcs (>= 1.2.0, < 2.0)
|
258
262
|
rspec-support (~> 3.13.0)
|
259
263
|
rspec-support (3.13.1)
|
260
|
-
rubocop (1.
|
264
|
+
rubocop (1.69.0)
|
261
265
|
json (~> 2.3)
|
262
266
|
language_server-protocol (>= 3.17.0)
|
263
267
|
parallel (~> 1.10)
|
264
268
|
parser (>= 3.3.0.2)
|
265
269
|
rainbow (>= 2.2.2, < 4.0)
|
266
270
|
regexp_parser (>= 2.4, < 3.0)
|
267
|
-
rubocop-ast (>= 1.
|
271
|
+
rubocop-ast (>= 1.36.1, < 2.0)
|
268
272
|
ruby-progressbar (~> 1.7)
|
269
|
-
unicode-display_width (>= 2.4.0, <
|
270
|
-
rubocop-ast (1.
|
273
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
274
|
+
rubocop-ast (1.36.2)
|
271
275
|
parser (>= 3.3.1.0)
|
272
276
|
rubocop-capybara (2.21.0)
|
273
277
|
rubocop (~> 1.41)
|
@@ -310,8 +314,9 @@ PLATFORMS
|
|
310
314
|
x86_64-linux
|
311
315
|
|
312
316
|
DEPENDENCIES
|
313
|
-
|
317
|
+
eac_config!
|
314
318
|
eac_ruby_gem_support (~> 0.10)
|
319
|
+
eac_ruby_utils!
|
315
320
|
eac_tools!
|
316
321
|
|
317
322
|
BUNDLED WITH
|
data/lib/eac_tools/version.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
+
|
5
|
+
require 'eac_config/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'eac_config'
|
9
|
+
s.version = EacConfig::VERSION
|
10
|
+
s.authors = ['Put here the authors']
|
11
|
+
s.summary = 'Put here de description.'
|
12
|
+
|
13
|
+
s.files = Dir['{lib}/**/*']
|
14
|
+
s.required_ruby_version = '>= 2.7.0'
|
15
|
+
|
16
|
+
s.add_dependency 'addressable', '~> 2.8', '>= 2.8.7'
|
17
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.124'
|
18
|
+
|
19
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.10'
|
20
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_config/entry_path'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module EacConfig
|
7
|
+
class Entries
|
8
|
+
require_sub __FILE__
|
9
|
+
enable_simple_cache
|
10
|
+
common_constructor :root_node, :path do
|
11
|
+
self.path = ::EacConfig::EntryPath.assert(path)
|
12
|
+
end
|
13
|
+
|
14
|
+
def to_s
|
15
|
+
"#{self.class}[RootNode: #{root_node}, Path: #{path}]"
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
# @return [Array<EacConfig::Entries>]
|
21
|
+
def node_entries_uncached
|
22
|
+
node_entries_from_root + node_entries_from_load_path
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [Array<EacConfig::Entries>]
|
26
|
+
def node_entries_from_load_path_uncached
|
27
|
+
root_node.recursive_loaded_nodes.flat_map { |loaded_node| loaded_node.self_entries(path) }
|
28
|
+
end
|
29
|
+
|
30
|
+
# @return [Array<EacConfig::Entries>]
|
31
|
+
def node_entries_from_root_uncached
|
32
|
+
root_node.self_entries(path)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_config/entry_path'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module EacConfig
|
7
|
+
class Entry
|
8
|
+
require_sub __FILE__
|
9
|
+
enable_simple_cache
|
10
|
+
common_constructor :root_node, :path do
|
11
|
+
self.path = ::EacConfig::EntryPath.assert(path)
|
12
|
+
end
|
13
|
+
|
14
|
+
def found?
|
15
|
+
node_entry.if_present(false, &:found?)
|
16
|
+
end
|
17
|
+
|
18
|
+
def found_node
|
19
|
+
node_entry.if_present(&:node)
|
20
|
+
end
|
21
|
+
|
22
|
+
def secret_value
|
23
|
+
node_entry.if_present(&:secret_value)
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_s
|
27
|
+
"#{self.class}[RootNode: #{root_node}, Path: #{path}]"
|
28
|
+
end
|
29
|
+
|
30
|
+
def value
|
31
|
+
node_entry.if_present(&:value)
|
32
|
+
end
|
33
|
+
|
34
|
+
def value!
|
35
|
+
return value if found?
|
36
|
+
|
37
|
+
raise ::EacConfig::Entry::NotFoundError, self
|
38
|
+
end
|
39
|
+
|
40
|
+
def value=(a_value)
|
41
|
+
write_node.self_entry(path).value = a_value
|
42
|
+
end
|
43
|
+
|
44
|
+
def write_node
|
45
|
+
root_node.write_node || root_node
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def node_entry_uncached
|
51
|
+
node_entry_from_root || node_entry_from_load_path
|
52
|
+
end
|
53
|
+
|
54
|
+
def node_entry_from_load_path_uncached
|
55
|
+
root_node.recursive_loaded_nodes.lazy.map { |loaded_node| loaded_node.self_entry(path) }
|
56
|
+
.find(&:found?)
|
57
|
+
end
|
58
|
+
|
59
|
+
def node_entry_from_root_uncached
|
60
|
+
e = root_node.self_entry(path)
|
61
|
+
e.found? ? e : nil
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module EacConfig
|
6
|
+
class EntryPath
|
7
|
+
PART_SEPARATOR = '.'
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def assert(source)
|
11
|
+
source.is_a?(self) ? source : new(build_parts(source))
|
12
|
+
end
|
13
|
+
|
14
|
+
def build_parts(source)
|
15
|
+
return validate_parts!(source.split(PART_SEPARATOR)) if source.is_a?(::String)
|
16
|
+
return validate_parts!(source.flat_map { |part| build_parts(part) }) if
|
17
|
+
source.is_a?(::Enumerable)
|
18
|
+
|
19
|
+
build_parts(source.to_s)
|
20
|
+
end
|
21
|
+
|
22
|
+
def validate_parts!(parts)
|
23
|
+
parts.assert_argument(::Enumerable, 'parts')
|
24
|
+
parts.each_with_index do |part, index|
|
25
|
+
raise ::ArgumentError, "Part #{index} of #{parts} is blank" if part.blank?
|
26
|
+
raise ::ArgumentError, "Part #{index} is not a string" unless part.is_a?(::String)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
common_constructor :parts, default: [[]] do
|
32
|
+
self.parts = ::Array.new(parts).freeze
|
33
|
+
end
|
34
|
+
|
35
|
+
compare_by :parts
|
36
|
+
delegate :any?, :count, :each, :each_value, :each_with_index, :empty?, :fetch, :first, :index,
|
37
|
+
:inject, :last, :map, :size, to: :parts
|
38
|
+
|
39
|
+
# @return [EacConfig::EntryPath]
|
40
|
+
def +(other)
|
41
|
+
self.class.new(parts + self.class.assert(other).parts)
|
42
|
+
end
|
43
|
+
|
44
|
+
def [](*args)
|
45
|
+
slice(*args)
|
46
|
+
end
|
47
|
+
|
48
|
+
def slice(*args)
|
49
|
+
r = parts.slice(*args)
|
50
|
+
r.is_a?(::Enumerable) ? self.class.new(r) : r
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_s
|
54
|
+
"#{self.class}[#{to_string}]"
|
55
|
+
end
|
56
|
+
|
57
|
+
# @return [String]
|
58
|
+
def to_string
|
59
|
+
parts.join(PART_SEPARATOR)
|
60
|
+
end
|
61
|
+
|
62
|
+
# @param part [String]
|
63
|
+
# @return [EacConfig::EntryPath]
|
64
|
+
def with_first(part)
|
65
|
+
new_parts = parts.dup
|
66
|
+
new_parts.unshift(part)
|
67
|
+
self.class.new(new_parts)
|
68
|
+
end
|
69
|
+
|
70
|
+
# @return [EacConfig::EntryPath]
|
71
|
+
def without_first
|
72
|
+
new_parts = parts.dup
|
73
|
+
new_parts.shift
|
74
|
+
self.class.new(new_parts)
|
75
|
+
end
|
76
|
+
|
77
|
+
# @return [EacConfig::EntryPath]
|
78
|
+
def with_last(part)
|
79
|
+
self.class.new(parts + [part])
|
80
|
+
end
|
81
|
+
|
82
|
+
# @return [EacConfig::EntryPath]
|
83
|
+
def without_last
|
84
|
+
new_parts = parts.dup
|
85
|
+
new_parts.pop
|
86
|
+
self.class.new(new_parts)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_config/entry_path'
|
4
|
+
require 'eac_config/node_entry'
|
5
|
+
require 'eac_ruby_utils/blank_not_blank'
|
6
|
+
require 'eac_ruby_utils/core_ext'
|
7
|
+
require 'eac_ruby_utils/yaml'
|
8
|
+
|
9
|
+
module EacConfig
|
10
|
+
class EnvvarsNode
|
11
|
+
class Entry < ::EacConfig::NodeEntry
|
12
|
+
class << self
|
13
|
+
def entry_path_to_envvar_name(path)
|
14
|
+
::EacConfig::EntryPath.assert(path).parts.join('_').gsub(/[^a-z0-9_]/i, '')
|
15
|
+
.gsub(/\A_+/, '').gsub(/_+\z/, '').gsub(/_{2,}/, '_').upcase
|
16
|
+
end
|
17
|
+
|
18
|
+
def from_value(string)
|
19
|
+
return nil if string.nil?
|
20
|
+
return ::EacRubyUtils::Yaml.load(string) if string.start_with?('---')
|
21
|
+
|
22
|
+
string
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_value(object)
|
26
|
+
return nil if object.nil?
|
27
|
+
return object if object.is_a?(String)
|
28
|
+
|
29
|
+
::EacRubyUtils::Yaml.dump(object)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
enable_simple_cache
|
34
|
+
|
35
|
+
def found?
|
36
|
+
ENV.key?(envvar_name)
|
37
|
+
end
|
38
|
+
|
39
|
+
def value
|
40
|
+
self.class.from_value(ENV.fetch(envvar_name, nil))
|
41
|
+
end
|
42
|
+
|
43
|
+
def value=(a_value)
|
44
|
+
ENV[envvar_name] = self.class.to_value(a_value)
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def envvar_name_uncached
|
50
|
+
self.class.entry_path_to_envvar_name(path)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'addressable'
|
4
|
+
require 'eac_config/node'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module EacConfig
|
8
|
+
# A node that read/write entries from environment variables.
|
9
|
+
class EnvvarsNode
|
10
|
+
require_sub __FILE__
|
11
|
+
include ::EacConfig::Node
|
12
|
+
|
13
|
+
URI = ::Addressable::URI.parse('self://envvars')
|
14
|
+
|
15
|
+
class << self
|
16
|
+
def from_uri(uri)
|
17
|
+
new if uri == URI
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# @param path [EacConfig::EntryPath]
|
22
|
+
# @return [Array<EacConfig::Entries>]
|
23
|
+
def self_entries(_path)
|
24
|
+
[]
|
25
|
+
end
|
26
|
+
|
27
|
+
def url
|
28
|
+
URI
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_s
|
32
|
+
"#{self.class}[ObjectId: #{object_id}]}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module EacConfig
|
6
|
+
class LoadNodesSearch
|
7
|
+
common_constructor :root_node do
|
8
|
+
add_next_pending until pending.empty?
|
9
|
+
end
|
10
|
+
|
11
|
+
def result
|
12
|
+
added
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def added
|
18
|
+
@added ||= []
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_next_pending
|
22
|
+
current = pending.pop
|
23
|
+
current.self_loaded_nodes.each do |loaded_node|
|
24
|
+
next if added.include?(loaded_node)
|
25
|
+
|
26
|
+
added << loaded_node
|
27
|
+
pending.push(loaded_node)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def pending
|
32
|
+
@pending ||= begin
|
33
|
+
r = Queue.new
|
34
|
+
r.push(root_node)
|
35
|
+
r
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_config/entry_path'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module EacConfig
|
7
|
+
class LoadPath
|
8
|
+
ENTRY_PATH = ::EacConfig::EntryPath.assert(%w[load_path])
|
9
|
+
|
10
|
+
common_constructor :node
|
11
|
+
|
12
|
+
def entry
|
13
|
+
node.self_entry(ENTRY_PATH)
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [Array<String>]
|
17
|
+
def paths
|
18
|
+
r = entry.value
|
19
|
+
r.is_a?(::Array) ? r : []
|
20
|
+
end
|
21
|
+
|
22
|
+
def push(new_path)
|
23
|
+
entry.value = paths + [new_path]
|
24
|
+
end
|
25
|
+
|
26
|
+
delegate :to_s, to: :paths
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_config/entries'
|
4
|
+
require 'eac_config/entry'
|
5
|
+
require 'eac_config/entry_path'
|
6
|
+
require 'eac_config/load_path'
|
7
|
+
require 'eac_config/load_nodes_search'
|
8
|
+
require 'eac_config/node_entry'
|
9
|
+
require 'eac_config/node_uri'
|
10
|
+
require 'eac_ruby_utils/core_ext'
|
11
|
+
require 'eac_ruby_utils/context'
|
12
|
+
|
13
|
+
module EacConfig
|
14
|
+
module Node
|
15
|
+
class << self
|
16
|
+
def context
|
17
|
+
@context ||= ::EacRubyUtils::Context.new
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
attr_accessor :write_node
|
22
|
+
|
23
|
+
common_concern do
|
24
|
+
acts_as_abstract :self_entries
|
25
|
+
include ::Comparable
|
26
|
+
end
|
27
|
+
|
28
|
+
# @return [Array<EacConfig::Entries>]
|
29
|
+
def entries(path)
|
30
|
+
::EacConfig::Entries.new(self, path)
|
31
|
+
end
|
32
|
+
|
33
|
+
def entry(path)
|
34
|
+
::EacConfig::Entry.new(self, path)
|
35
|
+
end
|
36
|
+
|
37
|
+
# @return [[EacConfig::IncludePath]]
|
38
|
+
def load_path
|
39
|
+
@load_path ||= ::EacConfig::LoadPath.new(self)
|
40
|
+
end
|
41
|
+
|
42
|
+
# @return [Addressable::URI]
|
43
|
+
def url
|
44
|
+
raise_abstract_method(__method__)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Return a entry which search values only in the self node.
|
48
|
+
# @return [EacConfig::NodeEntry]
|
49
|
+
def self_entry(path)
|
50
|
+
self_entry_class.new(self, path)
|
51
|
+
end
|
52
|
+
|
53
|
+
def self_entry_class
|
54
|
+
self.class.const_get('Entry')
|
55
|
+
end
|
56
|
+
|
57
|
+
# @return [Array<EacConfig::Node>]
|
58
|
+
def self_loaded_nodes
|
59
|
+
load_path.paths.flat_map { |node_path| load_nodes(node_path) }
|
60
|
+
end
|
61
|
+
|
62
|
+
# @return [Array<EacConfig::Node>]
|
63
|
+
def recursive_loaded_nodes
|
64
|
+
::EacConfig::LoadNodesSearch.new(self).result
|
65
|
+
end
|
66
|
+
|
67
|
+
# @return [EacConfig::PrefixedPathNode]
|
68
|
+
def with_prefix(path_prefix)
|
69
|
+
require 'eac_config/prefixed_path_node'
|
70
|
+
::EacConfig::PrefixedPathNode.new(self, path_prefix)
|
71
|
+
end
|
72
|
+
|
73
|
+
private
|
74
|
+
|
75
|
+
# @param node_path [String]
|
76
|
+
# @return [Array<EacConfig::Node>]
|
77
|
+
def load_nodes(node_path)
|
78
|
+
::EacConfig::NodeUri.new(node_path, url).instanciate
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_config/entry_path'
|
4
|
+
require 'eac_config/paths_hash'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module EacConfig
|
8
|
+
# A entry which search values only in the source node.
|
9
|
+
class NodeEntry
|
10
|
+
enable_abstract_methods
|
11
|
+
enable_simple_cache
|
12
|
+
common_constructor :node, :path do
|
13
|
+
self.path = ::EacConfig::EntryPath.assert(path)
|
14
|
+
end
|
15
|
+
compare_by :node, :path
|
16
|
+
|
17
|
+
abstract_methods :found?, :value, :value=
|
18
|
+
|
19
|
+
def secret_value
|
20
|
+
value
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [String]
|
24
|
+
def to_s
|
25
|
+
"#{self.class}[Node: #{node}, Path: #{path}]"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacConfig
|
4
|
+
class NodeUri
|
5
|
+
class InstanciateSingle
|
6
|
+
acts_as_instance_method
|
7
|
+
enable_simple_cache
|
8
|
+
common_constructor :node_uri, :instance_uri
|
9
|
+
|
10
|
+
# @return [Array<Class>]
|
11
|
+
def available_node_classes
|
12
|
+
require 'eac_config/envvars_node'
|
13
|
+
require 'eac_config/yaml_file_node'
|
14
|
+
[::EacConfig::EnvvarsNode, ::EacConfig::YamlFileNode]
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [EacConfig::Node]
|
18
|
+
def result
|
19
|
+
available_node_classes.lazy.map { |k| k.from_uri(self) }.find(&:present?) ||
|
20
|
+
raise("No class mapped for \"#{to_addressable}\"")
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [Addressable::URI]
|
24
|
+
def to_addressable
|
25
|
+
instance_uri.to_uri
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|