eac_ruby_utils 0.130.0 → 0.131.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eac_ruby_utils/acts_as_abstract.rb +1 -1
- data/lib/eac_ruby_utils/by_reference.rb +2 -2
- data/lib/eac_ruby_utils/byte.rb +2 -2
- data/lib/eac_ruby_utils/common_concern/class_setup.rb +4 -4
- data/lib/eac_ruby_utils/common_concern/module_setup.rb +2 -2
- data/lib/eac_ruby_utils/custom_format.rb +2 -2
- data/lib/eac_ruby_utils/enum.rb +2 -2
- data/lib/eac_ruby_utils/envs/executable.rb +3 -3
- data/lib/eac_ruby_utils/envs/ssh_env.rb +3 -3
- data/lib/eac_ruby_utils/gems_registry/gem/dependencies.rb +6 -7
- data/lib/eac_ruby_utils/gems_registry/gem/paths_to_require.rb +2 -2
- data/lib/eac_ruby_utils/gems_registry/gem.rb +2 -2
- data/lib/eac_ruby_utils/inflector.rb +1 -1
- data/lib/eac_ruby_utils/listable/instance_methods.rb +1 -1
- data/lib/eac_ruby_utils/listable/list.rb +3 -3
- data/lib/eac_ruby_utils/listable/lists.rb +1 -1
- data/lib/eac_ruby_utils/listable.rb +1 -1
- data/lib/eac_ruby_utils/local_time_zone.rb +1 -1
- data/lib/eac_ruby_utils/objects_table.rb +2 -2
- data/lib/eac_ruby_utils/patches/hash.rb +1 -1
- data/lib/eac_ruby_utils/patches/module/common_concern.rb +2 -2
- data/lib/eac_ruby_utils/patches/module/enable_memoized.rb +10 -0
- data/lib/eac_ruby_utils/patches/object/recursive_build.rb +2 -2
- data/lib/eac_ruby_utils/patches/object.rb +1 -1
- data/lib/eac_ruby_utils/patches/pathname/reqdir_glob.rb +2 -2
- data/lib/eac_ruby_utils/patches/regexp/to_parser.rb +2 -2
- data/lib/eac_ruby_utils/recursive_builder.rb +7 -7
- data/lib/eac_ruby_utils/require_sub/base.rb +1 -1
- data/lib/eac_ruby_utils/root_module_setup/ignore.rb +6 -5
- data/lib/eac_ruby_utils/root_module_setup.rb +2 -2
- data/lib/eac_ruby_utils/ruby/on_clean_environment.rb +2 -2
- data/lib/eac_ruby_utils/ruby/on_replace_objects.rb +6 -6
- data/lib/eac_ruby_utils/settings_provider/setting_value.rb +3 -3
- data/lib/eac_ruby_utils/simple_cache.rb +3 -3
- data/lib/eac_ruby_utils/speaker/receiver.rb +2 -2
- data/lib/eac_ruby_utils/struct.rb +1 -1
- data/lib/eac_ruby_utils/version.rb +1 -1
- metadata +32 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee08da003c54da3d964080152a3a6e99b9303b49fcb22e46a0022d8d9ebeeee4
|
|
4
|
+
data.tar.gz: 404554dc577e974e408300d84bdc106f7baac433714a01a2a371a17098c3e049
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 795e1bb1630b1a29f21cd79366894a9bd3b13a82a9e5c68b9b29e4b439e5dea5c70549214b52def3f04f6a6f4a71690e30c3906d5e4397cc455c51adb25d52a4
|
|
7
|
+
data.tar.gz: 456a2ba4facf2e8b5b4d31b9f652c4a82aa79279f5dba1a9d7db3a1026a759e035f4c7a292f8599b7f0eea26e8b47d96c46b5c5356ab8d7f7cccbb1df933ff7f
|
|
@@ -6,8 +6,8 @@ module EacRubyUtils
|
|
|
6
6
|
@object_provider = object_provider
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
def method_missing(method_name,
|
|
10
|
-
return object.send(method_name,
|
|
9
|
+
def method_missing(method_name, *, &)
|
|
10
|
+
return object.send(method_name, *, &) if object.respond_to?(method_name)
|
|
11
11
|
|
|
12
12
|
super
|
|
13
13
|
end
|
data/lib/eac_ruby_utils/byte.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'active_support/concern'
|
|
4
|
-
require '
|
|
4
|
+
require 'memoized'
|
|
5
5
|
require 'eac_ruby_utils/patches/object/if_present'
|
|
6
6
|
|
|
7
7
|
module EacRubyUtils
|
|
8
8
|
class CommonConcern
|
|
9
9
|
class ClassSetup
|
|
10
|
-
include ::
|
|
10
|
+
include ::Memoized
|
|
11
11
|
|
|
12
12
|
attr_reader :a_class, :module_setup, :include_method
|
|
13
13
|
|
|
@@ -37,13 +37,13 @@ module EacRubyUtils
|
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
def
|
|
40
|
+
memoize def class_methods_module
|
|
41
41
|
module_setup.a_module.const_get(CLASS_METHODS_MODULE_NAME)
|
|
42
42
|
rescue NameError
|
|
43
43
|
nil
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
def
|
|
46
|
+
memoize def instance_methods_module
|
|
47
47
|
module_setup.a_module.const_get(INSTANCE_METHODS_MODULE_NAME)
|
|
48
48
|
rescue NameError
|
|
49
49
|
nil
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
require 'active_support/concern'
|
|
4
4
|
require 'eac_ruby_utils/common_concern/class_setup'
|
|
5
|
-
require '
|
|
5
|
+
require 'memoized'
|
|
6
6
|
require 'eac_ruby_utils/patches/object/if_present'
|
|
7
7
|
|
|
8
8
|
module EacRubyUtils
|
|
9
9
|
class CommonConcern
|
|
10
10
|
class ModuleSetup
|
|
11
|
-
include ::
|
|
11
|
+
include ::Memoized
|
|
12
12
|
|
|
13
13
|
attr_reader :a_module, :common_concern
|
|
14
14
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module EacRubyUtils
|
|
4
4
|
# A formatter like [String.sprintf].
|
|
5
5
|
class CustomFormat
|
|
6
|
-
TYPE_PATTERN = /[a-zA-Z]
|
|
7
|
-
SEQUENCE_PATTERN = /(?<!%)%(#{TYPE_PATTERN})
|
|
6
|
+
TYPE_PATTERN = /[a-zA-Z]/
|
|
7
|
+
SEQUENCE_PATTERN = /(?<!%)%(#{TYPE_PATTERN})/
|
|
8
8
|
|
|
9
9
|
attr_reader :mapping
|
|
10
10
|
|
data/lib/eac_ruby_utils/enum.rb
CHANGED
|
@@ -6,8 +6,8 @@ module EacRubyUtils
|
|
|
6
6
|
# Similar to Java's enum type (https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html).
|
|
7
7
|
class Enum
|
|
8
8
|
class << self
|
|
9
|
-
def enum(key, *args, &
|
|
10
|
-
value = Value.new(self, key, args, &
|
|
9
|
+
def enum(key, *args, &)
|
|
10
|
+
value = Value.new(self, key, args, &)
|
|
11
11
|
raise ::ArgumentError, "#{self} already has a value with key=#{value.key}" if
|
|
12
12
|
value_set.include?(value)
|
|
13
13
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'eac_ruby_utils/listable'
|
|
4
|
-
require '
|
|
4
|
+
require 'memoized'
|
|
5
5
|
|
|
6
6
|
module EacRubyUtils
|
|
7
7
|
module Envs
|
|
8
8
|
class Executable
|
|
9
9
|
include ::EacRubyUtils::Listable
|
|
10
|
-
include ::
|
|
10
|
+
include ::Memoized
|
|
11
11
|
|
|
12
12
|
lists.add_symbol :option, :check_args, :exec_args, :auto_validate
|
|
13
13
|
|
|
@@ -80,7 +80,7 @@ module EacRubyUtils
|
|
|
80
80
|
|
|
81
81
|
attr_writer :options
|
|
82
82
|
|
|
83
|
-
def
|
|
83
|
+
memoize def exist
|
|
84
84
|
env.command(*executable_args, *check_args).execute!
|
|
85
85
|
true
|
|
86
86
|
rescue Errno::ENOENT
|
|
@@ -12,9 +12,9 @@ module EacRubyUtils
|
|
|
12
12
|
class SshEnv < ::EacRubyUtils::Envs::BaseEnv
|
|
13
13
|
require_sub __FILE__, include_modules: true
|
|
14
14
|
|
|
15
|
-
USER_PATTERN = /[a-z_][a-z0-9_-]
|
|
16
|
-
HOSTNAME_PATTERN = /[^@]
|
|
17
|
-
USER_HOSTNAME_PATTERN = /\A(?:(#{USER_PATTERN})@)?(#{HOSTNAME_PATTERN})\z
|
|
15
|
+
USER_PATTERN = /[a-z_][a-z0-9_-]*/
|
|
16
|
+
HOSTNAME_PATTERN = /[^@]+/
|
|
17
|
+
USER_HOSTNAME_PATTERN = /\A(?:(#{USER_PATTERN})@)?(#{HOSTNAME_PATTERN})\z/
|
|
18
18
|
|
|
19
19
|
class << self
|
|
20
20
|
def parse_uri(uri)
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'eac_ruby_utils/recursive_builder'
|
|
4
|
+
require 'memoized'
|
|
4
5
|
|
|
5
6
|
module EacRubyUtils
|
|
6
7
|
class GemsRegistry
|
|
7
8
|
class Gem
|
|
8
9
|
module Dependencies
|
|
10
|
+
include ::Memoized
|
|
11
|
+
|
|
9
12
|
def depend_on(gem) # rubocop:disable Naming/PredicateMethod
|
|
10
13
|
dependencies.lazy.map(&:name).include?(gem.gemspec.name)
|
|
11
14
|
end
|
|
12
15
|
|
|
13
|
-
def dependencies
|
|
14
|
-
@dependencies ||= dependencies_uncached # dependencies_uncached
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
private
|
|
18
|
-
|
|
19
|
-
def dependencies_uncached
|
|
16
|
+
memoize def dependencies
|
|
20
17
|
::EacRubyUtils::RecursiveBuilder
|
|
21
18
|
.new(gemspec) { |item| gem_item_dependencies(item) }
|
|
22
19
|
.result
|
|
23
20
|
end
|
|
24
21
|
|
|
22
|
+
private
|
|
23
|
+
|
|
25
24
|
# @return [Array<Gem::Dependency>]
|
|
26
25
|
def gem_item_dependencies(item)
|
|
27
26
|
::Gem::Specification.find_by_name(item.name).dependencies.select(&:runtime?)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require 'active_support/core_ext/string/inflections'
|
|
4
4
|
require 'eac_ruby_utils/recursive_builder'
|
|
5
|
-
require '
|
|
5
|
+
require 'memoized'
|
|
6
6
|
|
|
7
7
|
module EacRubyUtils
|
|
8
8
|
class GemsRegistry
|
|
@@ -41,7 +41,7 @@ module EacRubyUtils
|
|
|
41
41
|
next false unless e.file?
|
|
42
42
|
|
|
43
43
|
content = e.read
|
|
44
|
-
ROOT_MODULE_REQUIRE_PATTERNS.any? { |e| content.include?(e) }
|
|
44
|
+
ROOT_MODULE_REQUIRE_PATTERNS.any? { |e| content.include?(e) } # rubocop:disable Style/ArrayIntersect
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
require 'active_support/core_ext/string/inflections'
|
|
4
4
|
require 'eac_ruby_utils/gems_registry/gem/dependencies'
|
|
5
5
|
require 'eac_ruby_utils/gems_registry/gem/paths_to_require'
|
|
6
|
-
require '
|
|
6
|
+
require 'memoized'
|
|
7
7
|
|
|
8
8
|
module EacRubyUtils
|
|
9
9
|
class GemsRegistry
|
|
@@ -11,7 +11,7 @@ module EacRubyUtils
|
|
|
11
11
|
include ::Comparable
|
|
12
12
|
include ::EacRubyUtils::GemsRegistry::Gem::Dependencies
|
|
13
13
|
include ::EacRubyUtils::GemsRegistry::Gem::PathsToRequire
|
|
14
|
-
include ::
|
|
14
|
+
include ::Memoized
|
|
15
15
|
|
|
16
16
|
attr_reader :registry, :gemspec
|
|
17
17
|
|
|
@@ -5,7 +5,7 @@ require 'active_support/inflector'
|
|
|
5
5
|
module EacRubyUtils
|
|
6
6
|
class Inflector
|
|
7
7
|
class << self
|
|
8
|
-
VARIABLE_NAME_PATTERN = /[_a-z][_a-z0-9]*/i
|
|
8
|
+
VARIABLE_NAME_PATTERN = /[_a-z][_a-z0-9]*/i
|
|
9
9
|
|
|
10
10
|
# Convert a string to a variable format: first character as a lowercase letter or underscore
|
|
11
11
|
# and other as a lowercase letter, underscore or numbers.
|
|
@@ -5,7 +5,7 @@ module EacRubyUtils
|
|
|
5
5
|
module InstanceMethods
|
|
6
6
|
LISTABLE_INSTANCE_VALUE_METHODS = %w[label description].freeze
|
|
7
7
|
|
|
8
|
-
def method_missing(name, *args, &
|
|
8
|
+
def method_missing(name, *args, &)
|
|
9
9
|
list, method = parse_method(name)
|
|
10
10
|
list && method ? list.instance_value(self).send(method) : super
|
|
11
11
|
end
|
|
@@ -21,8 +21,8 @@ module EacRubyUtils
|
|
|
21
21
|
@blank_value ||= ::EacRubyUtils::Listable::Item.new(self, BLANK_VALUE, BLANK_KEY, false)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
def each_value(&
|
|
25
|
-
values.each(&
|
|
24
|
+
def each_value(&)
|
|
25
|
+
values.each(&)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
# @return [EacRubyUtils::Listable::Item, nil]
|
|
@@ -51,7 +51,7 @@ module EacRubyUtils
|
|
|
51
51
|
[blank_value.to_option] + options
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
def method_missing(name, *args, &
|
|
54
|
+
def method_missing(name, *args, &)
|
|
55
55
|
list = find_list_by_method(name)
|
|
56
56
|
list || super
|
|
57
57
|
end
|
|
@@ -8,7 +8,7 @@ module EacRubyUtils
|
|
|
8
8
|
DEBIAN_CONFIG_PATH = '/etc/timezone'
|
|
9
9
|
|
|
10
10
|
class << self
|
|
11
|
-
TIMEDATECTL_TIMEZONE_LINE_PATTERN = %r{\s*Time zone:\s*(\S+/\S+)\s}
|
|
11
|
+
TIMEDATECTL_TIMEZONE_LINE_PATTERN = %r{\s*Time zone:\s*(\S+/\S+)\s}
|
|
12
12
|
|
|
13
13
|
# @return [ActiveSupport::TimeZone]
|
|
14
14
|
def auto
|
|
@@ -30,9 +30,9 @@ module EacRubyUtils
|
|
|
30
30
|
super || BY_PARSER.parse?(method_name)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
def method_missing(method_name,
|
|
33
|
+
def method_missing(method_name, *, &)
|
|
34
34
|
if (parsed = BY_PARSER.parse(method_name))
|
|
35
|
-
return send(parsed.method_name, parsed.attribute,
|
|
35
|
+
return send(parsed.method_name, parsed.attribute, *, &)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
super
|
|
@@ -6,7 +6,7 @@ class Object
|
|
|
6
6
|
# Equivalent to +EacRubyUtils::RecursiveBuilder.new(self, &neighbors_block).result+.
|
|
7
7
|
# @param &neighbors_block [Proc]
|
|
8
8
|
# @return [Enumerable]
|
|
9
|
-
def recursive_build(&
|
|
10
|
-
::EacRubyUtils::RecursiveBuilder.new(self, &
|
|
9
|
+
def recursive_build(&)
|
|
10
|
+
::EacRubyUtils::RecursiveBuilder.new(self, &).result
|
|
11
11
|
end
|
|
12
12
|
end
|
|
@@ -5,9 +5,9 @@ require 'pathname'
|
|
|
5
5
|
class Pathname
|
|
6
6
|
# A .glob that raises a ::RuntimeError if +self+ is not a directory.
|
|
7
7
|
# @return [Pathname]
|
|
8
|
-
def reqdir_glob(*
|
|
8
|
+
def reqdir_glob(*)
|
|
9
9
|
raise "\"#{self}\" is not a directory" unless directory?
|
|
10
10
|
|
|
11
|
-
glob(*
|
|
11
|
+
glob(*)
|
|
12
12
|
end
|
|
13
13
|
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require '
|
|
3
|
+
require 'memoized'
|
|
4
4
|
|
|
5
5
|
module EacRubyUtils
|
|
6
6
|
class RecursiveBuilder
|
|
7
|
-
include ::
|
|
7
|
+
include ::Memoized
|
|
8
8
|
|
|
9
9
|
attr_reader :root, :neighbors_block
|
|
10
10
|
|
|
@@ -13,11 +13,7 @@ module EacRubyUtils
|
|
|
13
13
|
@neighbors_block = neighbors_block
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
attr_reader :added, :to_check
|
|
19
|
-
|
|
20
|
-
def result_uncached
|
|
16
|
+
memoize def result
|
|
21
17
|
@added = []
|
|
22
18
|
@to_check = []
|
|
23
19
|
item_try_add_to_check(root)
|
|
@@ -27,6 +23,10 @@ module EacRubyUtils
|
|
|
27
23
|
added
|
|
28
24
|
end
|
|
29
25
|
|
|
26
|
+
private
|
|
27
|
+
|
|
28
|
+
attr_reader :added, :to_check
|
|
29
|
+
|
|
30
30
|
def item_try_add_to_check(item)
|
|
31
31
|
to_check << item unless item_added?(item)
|
|
32
32
|
end
|
|
@@ -85,7 +85,7 @@ module EacRubyUtils
|
|
|
85
85
|
# @return [Enumerable<EacRubyUtils::RequireSub::SubFile>]
|
|
86
86
|
def sub_files
|
|
87
87
|
@sub_files ||= Dir["#{File.dirname(file)}/#{::File.basename(file, '.*')}" \
|
|
88
|
-
"#{'/**' if recursive?}/*.rb"]
|
|
88
|
+
"#{'/**' if recursive?}/*.rb"]
|
|
89
89
|
.map { |path| ::EacRubyUtils::RequireSub::SubFile.new(self, path) }
|
|
90
90
|
end
|
|
91
91
|
end
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
require 'eac_ruby_utils/patches/module/acts_as_instance_method'
|
|
4
4
|
require 'eac_ruby_utils/patches/object/to_pathname'
|
|
5
|
-
require 'eac_ruby_utils/patches/module/simple_cache'
|
|
6
5
|
require 'eac_ruby_utils/patches/pathname/basename_sub'
|
|
6
|
+
require 'memoized'
|
|
7
7
|
|
|
8
8
|
module EacRubyUtils
|
|
9
9
|
class RootModuleSetup
|
|
10
10
|
class Ignore
|
|
11
|
+
include ::Memoized
|
|
12
|
+
|
|
11
13
|
acts_as_instance_method
|
|
12
|
-
enable_simple_cache
|
|
13
14
|
common_constructor :setup, :path do
|
|
14
15
|
self.path = path.to_pathname
|
|
15
16
|
end
|
|
@@ -25,7 +26,7 @@ module EacRubyUtils
|
|
|
25
26
|
protected
|
|
26
27
|
|
|
27
28
|
# @return [Pathname]
|
|
28
|
-
def
|
|
29
|
+
memoize def absolute_path
|
|
29
30
|
path.expand_path(root_module_directory)
|
|
30
31
|
end
|
|
31
32
|
|
|
@@ -43,8 +44,8 @@ module EacRubyUtils
|
|
|
43
44
|
end
|
|
44
45
|
|
|
45
46
|
# @return [Pathname]
|
|
46
|
-
def
|
|
47
|
-
return [absolute_path] if %w[* ?].any? { |e| absolute_path.to_path.include?(e) }
|
|
47
|
+
memoize def target_paths
|
|
48
|
+
return [absolute_path] if %w[* ?].any? { |e| absolute_path.to_path.include?(e) } # rubocop:disable Style/ArrayIntersect
|
|
48
49
|
|
|
49
50
|
r = []
|
|
50
51
|
r << absolute_path if absolute_path.directory?
|
|
@@ -7,8 +7,8 @@ module EacRubyUtils
|
|
|
7
7
|
module Ruby
|
|
8
8
|
class << self
|
|
9
9
|
# Executes a block in an environment when the variables BUNDLE* and RUBY* are removed.
|
|
10
|
-
def on_clean_environment(&
|
|
11
|
-
OnCleanEnvironment.new(&
|
|
10
|
+
def on_clean_environment(&)
|
|
11
|
+
OnCleanEnvironment.new(&).perform
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
class OnCleanEnvironment
|
|
@@ -22,18 +22,18 @@ module EacRubyUtils
|
|
|
22
22
|
restore_replacements
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
def replace_instance_method(a_module, method_name, &
|
|
26
|
-
add_replacement(__method__, a_module, method_name, &
|
|
25
|
+
def replace_instance_method(a_module, method_name, &)
|
|
26
|
+
add_replacement(__method__, a_module, method_name, &)
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def replace_self_method(object, method_name, &
|
|
30
|
-
add_replacement(:replace_instance_method, object.singleton_class, method_name, &
|
|
29
|
+
def replace_self_method(object, method_name, &)
|
|
30
|
+
add_replacement(:replace_instance_method, object.singleton_class, method_name, &)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
private
|
|
34
34
|
|
|
35
|
-
def add_replacement(method_name,
|
|
36
|
-
@replacements << replacement_class(method_name).new(
|
|
35
|
+
def add_replacement(method_name, *, &)
|
|
36
|
+
@replacements << replacement_class(method_name).new(*, &).apply
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def replacement_class(method_name)
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
require 'active_support/core_ext/string/inflections'
|
|
4
4
|
require 'eac_ruby_utils/listable'
|
|
5
|
-
require '
|
|
5
|
+
require 'memoized'
|
|
6
6
|
require 'eac_ruby_utils/struct'
|
|
7
7
|
|
|
8
8
|
module EacRubyUtils
|
|
9
9
|
module SettingsProvider
|
|
10
10
|
class SettingValue
|
|
11
11
|
include ::EacRubyUtils::Listable
|
|
12
|
-
include ::
|
|
12
|
+
include ::Memoized
|
|
13
13
|
|
|
14
14
|
attr_reader :source, :key, :options
|
|
15
15
|
|
|
@@ -63,7 +63,7 @@ module EacRubyUtils
|
|
|
63
63
|
|
|
64
64
|
private
|
|
65
65
|
|
|
66
|
-
def
|
|
66
|
+
memoize def parsed_options
|
|
67
67
|
r = self.class.lists.option.hash_keys_validate!(options.symbolize_keys)
|
|
68
68
|
r[:required] = true unless r.key?(OPTION_REQUIRED)
|
|
69
69
|
r[:order] = source.setting_search_order if r[OPTION_ORDER].nil?
|
|
@@ -5,7 +5,7 @@ module EacRubyUtils
|
|
|
5
5
|
UNCACHED_METHOD_NAME_SUFFIX = '_uncached'
|
|
6
6
|
UNCACHED_METHOD_PATTERN = /
|
|
7
7
|
\A(\s+)_#{::Regexp.quote(UNCACHED_METHOD_NAME_SUFFIX)}([!?]?)\z
|
|
8
|
-
/x
|
|
8
|
+
/x
|
|
9
9
|
|
|
10
10
|
class << self
|
|
11
11
|
def uncached_method_name(method_name)
|
|
@@ -19,9 +19,9 @@ module EacRubyUtils
|
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
def method_missing(method, *args, &
|
|
22
|
+
def method_missing(method, *args, &)
|
|
23
23
|
if respond_to?(uncached_method_name(method), true)
|
|
24
|
-
call_method_with_cache(method, args, &
|
|
24
|
+
call_method_with_cache(method, args, &)
|
|
25
25
|
else
|
|
26
26
|
super
|
|
27
27
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eac_ruby_utils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.131.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esquilo Azul Company
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -16,40 +16,28 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
20
|
-
- - "<"
|
|
21
|
-
- !ruby/object:Gem::Version
|
|
22
|
-
version: '7'
|
|
19
|
+
version: 6.1.7.10
|
|
23
20
|
type: :runtime
|
|
24
21
|
prerelease: false
|
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
23
|
requirements:
|
|
27
24
|
- - ">="
|
|
28
25
|
- !ruby/object:Gem::Version
|
|
29
|
-
version:
|
|
30
|
-
- - "<"
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
version: '7'
|
|
26
|
+
version: 6.1.7.10
|
|
33
27
|
- !ruby/object:Gem::Dependency
|
|
34
28
|
name: addressable
|
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
|
36
30
|
requirements:
|
|
37
31
|
- - "~>"
|
|
38
32
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '2.
|
|
40
|
-
- - ">="
|
|
41
|
-
- !ruby/object:Gem::Version
|
|
42
|
-
version: 2.8.8
|
|
33
|
+
version: '2.9'
|
|
43
34
|
type: :runtime
|
|
44
35
|
prerelease: false
|
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
46
37
|
requirements:
|
|
47
38
|
- - "~>"
|
|
48
39
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: '2.
|
|
50
|
-
- - ">="
|
|
51
|
-
- !ruby/object:Gem::Version
|
|
52
|
-
version: 2.8.8
|
|
40
|
+
version: '2.9'
|
|
53
41
|
- !ruby/object:Gem::Dependency
|
|
54
42
|
name: bundler
|
|
55
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -64,6 +52,26 @@ dependencies:
|
|
|
64
52
|
- - ">="
|
|
65
53
|
- !ruby/object:Gem::Version
|
|
66
54
|
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: memoized
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '1.1'
|
|
62
|
+
- - ">="
|
|
63
|
+
- !ruby/object:Gem::Version
|
|
64
|
+
version: 1.1.3
|
|
65
|
+
type: :runtime
|
|
66
|
+
prerelease: false
|
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
68
|
+
requirements:
|
|
69
|
+
- - "~>"
|
|
70
|
+
- !ruby/object:Gem::Version
|
|
71
|
+
version: '1.1'
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: 1.1.3
|
|
67
75
|
- !ruby/object:Gem::Dependency
|
|
68
76
|
name: net-ssh
|
|
69
77
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -87,7 +95,7 @@ dependencies:
|
|
|
87
95
|
version: '2.7'
|
|
88
96
|
- - ">="
|
|
89
97
|
- !ruby/object:Gem::Version
|
|
90
|
-
version: 2.7.
|
|
98
|
+
version: 2.7.5
|
|
91
99
|
type: :runtime
|
|
92
100
|
prerelease: false
|
|
93
101
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -97,7 +105,7 @@ dependencies:
|
|
|
97
105
|
version: '2.7'
|
|
98
106
|
- - ">="
|
|
99
107
|
- !ruby/object:Gem::Version
|
|
100
|
-
version: 2.7.
|
|
108
|
+
version: 2.7.5
|
|
101
109
|
- !ruby/object:Gem::Dependency
|
|
102
110
|
name: avm-eac_ubuntu_base0
|
|
103
111
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -118,20 +126,14 @@ dependencies:
|
|
|
118
126
|
requirements:
|
|
119
127
|
- - "~>"
|
|
120
128
|
- !ruby/object:Gem::Version
|
|
121
|
-
version: '0.
|
|
122
|
-
- - ">="
|
|
123
|
-
- !ruby/object:Gem::Version
|
|
124
|
-
version: 0.12.1
|
|
129
|
+
version: '0.13'
|
|
125
130
|
type: :development
|
|
126
131
|
prerelease: false
|
|
127
132
|
version_requirements: !ruby/object:Gem::Requirement
|
|
128
133
|
requirements:
|
|
129
134
|
- - "~>"
|
|
130
135
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: '0.
|
|
132
|
-
- - ">="
|
|
133
|
-
- !ruby/object:Gem::Version
|
|
134
|
-
version: 0.12.1
|
|
136
|
+
version: '0.13'
|
|
135
137
|
description:
|
|
136
138
|
email:
|
|
137
139
|
executables: []
|
|
@@ -267,6 +269,7 @@ files:
|
|
|
267
269
|
- lib/eac_ruby_utils/patches/module/common_concern.rb
|
|
268
270
|
- lib/eac_ruby_utils/patches/module/compare_by.rb
|
|
269
271
|
- lib/eac_ruby_utils/patches/module/context.rb
|
|
272
|
+
- lib/eac_ruby_utils/patches/module/enable_memoized.rb
|
|
270
273
|
- lib/eac_ruby_utils/patches/module/i18n_translate.rb
|
|
271
274
|
- lib/eac_ruby_utils/patches/module/immutable.rb
|
|
272
275
|
- lib/eac_ruby_utils/patches/module/listable.rb
|
|
@@ -351,7 +354,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
351
354
|
requirements:
|
|
352
355
|
- - ">="
|
|
353
356
|
- !ruby/object:Gem::Version
|
|
354
|
-
version: '2
|
|
357
|
+
version: '3.2'
|
|
355
358
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
356
359
|
requirements:
|
|
357
360
|
- - ">="
|