eac_ruby_utils 0.94.1 → 0.94.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42e10ce8f90ca6726da456c6a2296cfcf0d96bf0a4206cdef4a2ca67cf99bc49
4
- data.tar.gz: 9003e2761d3d975caedf977a6ed4d1e1ad952edb9fe6e103d84234fbceb8f5c8
3
+ metadata.gz: 6123804bfe63fb8449caccf2c037cc3e226c9d2859894feea80b5487fc472187
4
+ data.tar.gz: d47032f60cbd693dcd7ec2cfa72dcaf1c7c1bc69abd8354126f272a11a452702
5
5
  SHA512:
6
- metadata.gz: 2c02f79618161caf149d1fd21400ba66e7c637571415b7d59931d254ba1462057a87d45b309382c6d53345c1326a08f261da055f49db282951a903a77c6bcee0
7
- data.tar.gz: fa963ff8cc8cc135b3a51577b98607e4c3d1e02100e572531baf099f4b57bfef7e2294c6f7ae7899063f97ef05ffbe2f41353dde92e08fac7200c5113e3d2482
6
+ metadata.gz: d2edf68d551b316ba760f7c7c89a03b6b85262e9e6843506f7346d9f92a883cfe43a2efd591a497389bdde11dee9bcc19b5443aa4ba7e130d167ecfec047e9b8
7
+ data.tar.gz: 11fd72d374f34a61bba2d856ccfae437dc97010e8f2b074a6cb6f4ed2867a9f1f8515e073b4986b93518dd7b7d04a9293b71b5934d8d09582c66acb4e494f37b
@@ -9,7 +9,7 @@ module EacRubyUtils
9
9
  attr_reader :mapping
10
10
 
11
11
  def initialize(mapping)
12
- @mapping = mapping.map { |k, v| [k.to_sym, v] }.to_h.freeze
12
+ @mapping = mapping.transform_keys(&:to_sym).freeze
13
13
  end
14
14
 
15
15
  def format(string)
@@ -41,7 +41,7 @@ module EacRubyUtils
41
41
  def lib_file_found?
42
42
  gemspec.require_paths.any? do |require_path|
43
43
  ::Pathname.new(require_path).expand_path(gemspec.gem_dir).join(path_to_require + '.rb')
44
- .file?
44
+ .file?
45
45
  end
46
46
  end
47
47
 
@@ -29,7 +29,7 @@ module EacRubyUtils
29
29
  # @return [Array<EacRubyUtils::GemsRegistry::Gem>]
30
30
  def all_gems
31
31
  ::Gem::Specification.map { |gemspec| ::EacRubyUtils::GemsRegistry::Gem.new(self, gemspec) }
32
- .sort
32
+ .sort
33
33
  end
34
34
  end
35
35
  end
@@ -16,7 +16,7 @@ module EacRubyUtils
16
16
  # @raise [ArgumentError]
17
17
  def variableize(string, validate = true)
18
18
  r = ::ActiveSupport::Inflector.transliterate(string).gsub(/[^_a-z0-9]/i, '_')
19
- .gsub(/_+/, '_').gsub(/_\z/, '').gsub(/\A_/, '').downcase
19
+ .gsub(/_+/, '_').gsub(/_\z/, '').gsub(/\A_/, '').downcase
20
20
  m = VARIABLE_NAME_PATTERN.match(r)
21
21
  return r if m
22
22
  return nil unless validate
@@ -43,7 +43,7 @@ module EacRubyUtils
43
43
  end
44
44
 
45
45
  def hash_keys_validate!(hash, error_class = ::StandardError)
46
- hash.keys.each { |key| value_validate!(key, error_class) }
46
+ hash.each_key { |key| value_validate!(key, error_class) }
47
47
  hash
48
48
  end
49
49
 
@@ -82,7 +82,7 @@ module EacRubyUtils
82
82
  end
83
83
 
84
84
  def find_list_by_method(method)
85
- @values.values.each do |v|
85
+ @values.each_value do |v|
86
86
  return v if method.to_s == "value_#{v.key}"
87
87
  end
88
88
  nil
@@ -93,7 +93,7 @@ module EacRubyUtils
93
93
  end
94
94
 
95
95
  def apply_constants
96
- @values.values.each do |v|
96
+ @values.each_value do |v|
97
97
  @lists.source.const_set(v.constant_name, v.value)
98
98
  end
99
99
  end
@@ -36,7 +36,7 @@ module EacRubyUtils
36
36
  return nil unless executable.exist?
37
37
 
38
38
  TIMEDATECTL_TIMEZONE_LINE_PATTERN.if_match(executable.command.execute!) { |m| m[1] }
39
- .if_present { |v| ::ActiveSupport::TimeZone[v] }
39
+ .if_present { |v| ::ActiveSupport::TimeZone[v] }
40
40
  end
41
41
 
42
42
  # @return [ActiveSupport::TimeZone]
@@ -12,7 +12,7 @@ module EacRubyUtils
12
12
 
13
13
  def on_clean_envvars(*start_with_vars)
14
14
  old_values = envvars_starting_with(start_with_vars)
15
- old_values.keys.each { |k| ENV.delete(k) }
15
+ old_values.each_key { |k| ENV.delete(k) }
16
16
  yield
17
17
  ensure
18
18
  old_values&.each { |k, v| ENV[k] = v }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.94.1'
4
+ VERSION = '0.94.2'
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.94.1
4
+ version: 0.94.2
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: 2022-06-02 00:00:00.000000000 Z
11
+ date: 2022-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 0.5.0
81
+ version: 0.5.1
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 0.5.0
88
+ version: 0.5.1
89
89
  description:
90
90
  email:
91
91
  executables: []