eac_ruby_utils 0.131.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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/lib/eac_ruby_utils/acts_as_abstract.rb +1 -1
  3. data/lib/eac_ruby_utils/by_reference.rb +2 -2
  4. data/lib/eac_ruby_utils/byte.rb +2 -2
  5. data/lib/eac_ruby_utils/custom_format.rb +2 -2
  6. data/lib/eac_ruby_utils/enum.rb +2 -2
  7. data/lib/eac_ruby_utils/envs/ssh_env.rb +3 -3
  8. data/lib/eac_ruby_utils/gems_registry/gem/paths_to_require.rb +1 -1
  9. data/lib/eac_ruby_utils/inflector.rb +1 -1
  10. data/lib/eac_ruby_utils/listable/instance_methods.rb +1 -1
  11. data/lib/eac_ruby_utils/listable/list.rb +3 -3
  12. data/lib/eac_ruby_utils/listable/lists.rb +1 -1
  13. data/lib/eac_ruby_utils/listable.rb +1 -1
  14. data/lib/eac_ruby_utils/local_time_zone.rb +1 -1
  15. data/lib/eac_ruby_utils/objects_table.rb +2 -2
  16. data/lib/eac_ruby_utils/patches/hash.rb +1 -1
  17. data/lib/eac_ruby_utils/patches/module/common_concern.rb +2 -2
  18. data/lib/eac_ruby_utils/patches/object/recursive_build.rb +2 -2
  19. data/lib/eac_ruby_utils/patches/object.rb +1 -1
  20. data/lib/eac_ruby_utils/patches/pathname/reqdir_glob.rb +2 -2
  21. data/lib/eac_ruby_utils/patches/regexp/to_parser.rb +2 -2
  22. data/lib/eac_ruby_utils/require_sub/base.rb +1 -1
  23. data/lib/eac_ruby_utils/root_module_setup/ignore.rb +1 -1
  24. data/lib/eac_ruby_utils/root_module_setup.rb +2 -2
  25. data/lib/eac_ruby_utils/ruby/on_clean_environment.rb +2 -2
  26. data/lib/eac_ruby_utils/ruby/on_replace_objects.rb +6 -6
  27. data/lib/eac_ruby_utils/simple_cache.rb +3 -3
  28. data/lib/eac_ruby_utils/speaker/receiver.rb +2 -2
  29. data/lib/eac_ruby_utils/struct.rb +1 -1
  30. data/lib/eac_ruby_utils/version.rb +1 -1
  31. metadata +7 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 776fa14e41fc339b941d625a5682c4bdfb27c083c89bc90e352df41ee2a2feb3
4
- data.tar.gz: 743e85524e9b40053731cf40821364f0d20154d77c9071f8dc121901b6154289
3
+ metadata.gz: ee08da003c54da3d964080152a3a6e99b9303b49fcb22e46a0022d8d9ebeeee4
4
+ data.tar.gz: 404554dc577e974e408300d84bdc106f7baac433714a01a2a371a17098c3e049
5
5
  SHA512:
6
- metadata.gz: 857a5d927090f9584ce323027ca9636d0402212dbca08894f9394b0fdb1a87c707cdeeaaf586ca50e84fd27377e65a68b1155b3adebb539bb6f628dd4aea1a25
7
- data.tar.gz: 110900052a9d9223028760c42359e1270fc28d8bd1da2fc553283f5678a4254ed26194f5d874deb6a828ddd5a4154607ff7c86a0e3209cc3957f82e1917cb4a0
6
+ metadata.gz: 795e1bb1630b1a29f21cd79366894a9bd3b13a82a9e5c68b9b29e4b439e5dea5c70549214b52def3f04f6a6f4a71690e30c3906d5e4397cc455c51adb25d52a4
7
+ data.tar.gz: 456a2ba4facf2e8b5b4d31b9f652c4a82aa79279f5dba1a9d7db3a1026a759e035f4c7a292f8599b7f0eea26e8b47d96c46b5c5356ab8d7f7cccbb1df933ff7f
@@ -76,7 +76,7 @@ module EacRubyUtils
76
76
  super || abstract_method?(method_name)
77
77
  end
78
78
 
79
- def method_missing(method_name, *arguments, &block)
79
+ def method_missing(method_name, *arguments, &)
80
80
  raise_abstract_method(method_name) if abstract_method?(method_name)
81
81
 
82
82
  super
@@ -6,8 +6,8 @@ module EacRubyUtils
6
6
  @object_provider = object_provider
7
7
  end
8
8
 
9
- def method_missing(method_name, *arguments, &block)
10
- return object.send(method_name, *arguments, &block) if object.respond_to?(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
@@ -8,8 +8,8 @@ module EacRubyUtils
8
8
  class Byte
9
9
  ASSEMBLY_HEXADECIMAL_PREFIX = '$'
10
10
  BIT_COUNT = 8
11
- BIT_INDEX_RANGE = (0..7).freeze
12
- VALUE_RANGE = (0..255).freeze
11
+ BIT_INDEX_RANGE = (0..7)
12
+ VALUE_RANGE = (0..255)
13
13
 
14
14
  class << self
15
15
  def assert(obj)
@@ -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]/.freeze
7
- SEQUENCE_PATTERN = /(?<!%)%(#{TYPE_PATTERN})/.freeze
6
+ TYPE_PATTERN = /[a-zA-Z]/
7
+ SEQUENCE_PATTERN = /(?<!%)%(#{TYPE_PATTERN})/
8
8
 
9
9
  attr_reader :mapping
10
10
 
@@ -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, &block)
10
- value = Value.new(self, key, args, &block)
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
 
@@ -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_-]*/.freeze
16
- HOSTNAME_PATTERN = /[^@]+/.freeze
17
- USER_HOSTNAME_PATTERN = /\A(?:(#{USER_PATTERN})@)?(#{HOSTNAME_PATTERN})\z/.freeze
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)
@@ -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
 
@@ -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.freeze
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, &block)
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(&block)
25
- values.each(&block)
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, &block)
54
+ def method_missing(name, *args, &)
55
55
  list = find_list_by_method(name)
56
56
  list || super
57
57
  end
@@ -21,7 +21,7 @@ module EacRubyUtils
21
21
  end
22
22
  end
23
23
 
24
- def method_missing(name, *args, &block)
24
+ def method_missing(name, *args, &)
25
25
  list = find_list_by_method(name)
26
26
  list || super
27
27
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support/concern'
4
- Dir["#{__dir__}/#{File.basename(__FILE__, '.*')}/*.rb"].sort.each do |partial|
4
+ Dir["#{__dir__}/#{File.basename(__FILE__, '.*')}/*.rb"].each do |partial|
5
5
  require partial
6
6
  end
7
7
 
@@ -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}.freeze
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, *arguments, &block)
33
+ def method_missing(method_name, *, &)
34
34
  if (parsed = BY_PARSER.parse(method_name))
35
- return send(parsed.method_name, parsed.attribute, *arguments, &block)
35
+ return send(parsed.method_name, parsed.attribute, *, &)
36
36
  end
37
37
 
38
38
  super
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Dir["#{File.dirname(__FILE__)}/#{File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
3
+ Dir["#{File.dirname(__FILE__)}/#{File.basename(__FILE__, '.*')}/*.rb"].each do |path|
4
4
  require path
5
5
  end
@@ -3,7 +3,7 @@
3
3
  require 'eac_ruby_utils/common_concern'
4
4
 
5
5
  class Module
6
- def common_concern(&after_callback)
7
- ::EacRubyUtils::CommonConcern.new(&after_callback).setup(self)
6
+ def common_concern(&)
7
+ ::EacRubyUtils::CommonConcern.new(&).setup(self)
8
8
  end
9
9
  end
@@ -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(&neighbors_block)
10
- ::EacRubyUtils::RecursiveBuilder.new(self, &neighbors_block).result
9
+ def recursive_build(&)
10
+ ::EacRubyUtils::RecursiveBuilder.new(self, &).result
11
11
  end
12
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Dir["#{File.dirname(__FILE__)}/#{File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
3
+ Dir["#{File.dirname(__FILE__)}/#{File.basename(__FILE__, '.*')}/*.rb"].each do |path|
4
4
  require path
5
5
  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(*args)
8
+ def reqdir_glob(*)
9
9
  raise "\"#{self}\" is not a directory" unless directory?
10
10
 
11
- glob(*args)
11
+ glob(*)
12
12
  end
13
13
  end
@@ -4,7 +4,7 @@ require 'eac_ruby_utils/regexp_parser'
4
4
 
5
5
  class Regexp
6
6
  # @return [::EacRubyUtils::RegexpParser]
7
- def to_parser(&block)
8
- ::EacRubyUtils::RegexpParser.new(self, &block)
7
+ def to_parser(&)
8
+ ::EacRubyUtils::RegexpParser.new(self, &)
9
9
  end
10
10
  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"].sort
88
+ "#{'/**' if recursive?}/*.rb"]
89
89
  .map { |path| ::EacRubyUtils::RequireSub::SubFile.new(self, path) }
90
90
  end
91
91
  end
@@ -45,7 +45,7 @@ module EacRubyUtils
45
45
 
46
46
  # @return [Pathname]
47
47
  memoize def target_paths
48
- return [absolute_path] if %w[* ?].any? { |e| absolute_path.to_path.include?(e) }
48
+ return [absolute_path] if %w[* ?].any? { |e| absolute_path.to_path.include?(e) } # rubocop:disable Style/ArrayIntersect
49
49
 
50
50
  r = []
51
51
  r << absolute_path if absolute_path.directory?
@@ -13,8 +13,8 @@ module EacRubyUtils
13
13
 
14
14
  class << self
15
15
  # @param root_module_file [String]
16
- def perform(root_module_file, &block)
17
- new(root_module_file, &block).perform
16
+ def perform(root_module_file, &)
17
+ new(root_module_file, &).perform
18
18
  end
19
19
  end
20
20
 
@@ -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(&block)
11
- OnCleanEnvironment.new(&block).perform
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, &block)
26
- add_replacement(__method__, a_module, method_name, &block)
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, &block)
30
- add_replacement(:replace_instance_method, object.singleton_class, method_name, &block)
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, *args, &block)
36
- @replacements << replacement_class(method_name).new(*args, &block).apply
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)
@@ -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.freeze
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, &block)
22
+ def method_missing(method, *args, &)
23
23
  if respond_to?(uncached_method_name(method), true)
24
- call_method_with_cache(method, args, &block)
24
+ call_method_with_cache(method, args, &)
25
25
  else
26
26
  super
27
27
  end
@@ -9,8 +9,8 @@ module EacRubyUtils
9
9
  extend ::EacRubyUtils::ActsAsAbstract
10
10
 
11
11
  module ClassMethods
12
- def on(*args, &block)
13
- ::EacRubyUtils::Speaker.context.on(new(*args), &block)
12
+ def on(*, &)
13
+ ::EacRubyUtils::Speaker.context.on(new(*), &)
14
14
  end
15
15
  end
16
16
 
@@ -25,7 +25,7 @@ module EacRubyUtils
25
25
  self.class.new(to_h.merge(other.to_h))
26
26
  end
27
27
 
28
- def method_missing(method_name, *arguments, &block)
28
+ def method_missing(method_name, *arguments, &)
29
29
  property_method?(method_name) ? fetch(method_name) : super
30
30
  end
31
31
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.131.0'
4
+ VERSION = '0.131.1'
5
5
  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.131.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-04-30 00:00:00.000000000 Z
11
+ date: 2026-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4'
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: '4'
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
@@ -132,20 +126,14 @@ dependencies:
132
126
  requirements:
133
127
  - - "~>"
134
128
  - !ruby/object:Gem::Version
135
- version: '0.12'
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: 0.12.2
129
+ version: '0.13'
139
130
  type: :development
140
131
  prerelease: false
141
132
  version_requirements: !ruby/object:Gem::Requirement
142
133
  requirements:
143
134
  - - "~>"
144
135
  - !ruby/object:Gem::Version
145
- version: '0.12'
146
- - - ">="
147
- - !ruby/object:Gem::Version
148
- version: 0.12.2
136
+ version: '0.13'
149
137
  description:
150
138
  email:
151
139
  executables: []
@@ -366,7 +354,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
366
354
  requirements:
367
355
  - - ">="
368
356
  - !ruby/object:Gem::Version
369
- version: '2.7'
357
+ version: '3.2'
370
358
  required_rubygems_version: !ruby/object:Gem::Requirement
371
359
  requirements:
372
360
  - - ">="