eac_config 0.14.0 → 0.14.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c50bab43bddae176c5e92caabd8ae79e623401376dc1a5f769c39b5949eaef9
4
- data.tar.gz: 5b798915ed8a7cf2b36123d6ae802070a5d54708466ad9ebbee8d31f66769840
3
+ metadata.gz: 496112538fc45570313afdec975bc75e76a610ea2840e29559b0e08943cd8674
4
+ data.tar.gz: 66720801251f13ced19a4604f8594612925e10e157778fb7bfb546f8fb6fa984
5
5
  SHA512:
6
- metadata.gz: 2520e4ec6b82ddd0b7b075566678a36ddbf04970ae3d844321b1335ea48dd170a390c24b5053ccf90d66ad8fc4ae29becf98e923cef7e334072b07c5182cfbc3
7
- data.tar.gz: 276d69584c163be6c4c128217c25270933a73a65b1c95bef8b451015a571c1cb114b0c18623e833cdd0a11903468b55a7ce2e74c487441997ec029674349c985
6
+ metadata.gz: ece1e6d5d1fa9009e0aa63cdcc318e4b35c630abe74aedc834ac3522b79e91a692ef66a6b66339e73f1645347184cae5fbb75551970ee5e31c5d5fd67cb892e4
7
+ data.tar.gz: 7245834faee13ad44f0eb0d9589b7e38f507f494d24f0b30253faf29ba431ae3c707199c74951f770b4b2f595c1d5f1278aea49cdde39ca9403885c7ee4fb46a
@@ -37,7 +37,7 @@ module EacConfig
37
37
  end
38
38
 
39
39
  def value
40
- self.class.from_value(ENV[envvar_name])
40
+ self.class.from_value(ENV.fetch(envvar_name, nil))
41
41
  end
42
42
 
43
43
  def value=(a_value)
@@ -14,7 +14,7 @@ module EacConfig
14
14
 
15
15
  class << self
16
16
  def from_uri(uri)
17
- return new if uri == URI
17
+ new if uri == URI
18
18
  end
19
19
  end
20
20
 
@@ -69,7 +69,7 @@ module EacConfig
69
69
  end
70
70
 
71
71
  def default_storage_path
72
- ::File.join(ENV['HOME'], '.config', configs_key, 'settings.yml')
72
+ ::File.join(Dir.home, '.config', configs_key, 'settings.yml')
73
73
  end
74
74
  end
75
75
  end
@@ -10,7 +10,7 @@ module EacConfig
10
10
 
11
11
  def initialize(source_hash)
12
12
  source_hash.assert_argument(Hash, 'source_hash')
13
- @data = source_hash.map { |k, v| [k.to_sym, v.is_a?(Hash) ? Node.new(v) : v] }.to_h
13
+ @data = source_hash.to_h { |k, v| [k.to_sym, v.is_a?(Hash) ? Node.new(v) : v] }
14
14
  end
15
15
 
16
16
  def entry?(path_search)
@@ -28,7 +28,7 @@ module EacConfig
28
28
  end
29
29
 
30
30
  def succeeding
31
- self.class.new(current[1..-1], previous + [cursor])
31
+ self.class.new(current[1..], previous + [cursor])
32
32
  end
33
33
 
34
34
  def to_s
@@ -7,7 +7,7 @@ module EacConfig
7
7
  require_sub __FILE__
8
8
 
9
9
  class << self
10
- def parse_entry_key(entry_key)
10
+ def parse_entry_key(entry_key) # rubocop:disable Metrics/CyclomaticComplexity
11
11
  r = entry_key.to_s.strip
12
12
  raise ::EacConfig::PathsHash::EntryKeyError, 'Entry key cannot start or end with dot' if
13
13
  r.start_with?('.') || r.end_with?('.')
@@ -53,11 +53,11 @@ module EacConfig
53
53
  node_builder.present? ? node_builder.call(file) : ::EacConfig::YamlFileNode.new(file)
54
54
  end
55
55
 
56
- def stub_eac_config_node_on_file(target_file)
56
+ def stub_eac_config_node_on_file(target_file, &block)
57
57
  if target_file
58
58
  yield(target_file.to_pathname)
59
59
  else
60
- ::EacRubyUtils::Fs::Temp.on_file { |file| yield(file) }
60
+ ::EacRubyUtils::Fs::Temp.on_file(&block)
61
61
  end
62
62
  end
63
63
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/core_exts'
3
+ require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module EacConfig
6
6
  module Rspec
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacConfig
4
- VERSION = '0.14.0'
4
+ VERSION = '0.14.2'
5
5
  end
@@ -39,7 +39,7 @@ module EacConfig
39
39
  def children
40
40
  return [] unless data_node.is_a?(::Hash)
41
41
 
42
- data_node.keys.select { |k| key_matcher.match?(k) }.map { |k| child(k) }
42
+ data_node.keys.select { |k| key_matcher.match?(k) }.map { |k| child(k) } # rubocop:disable Style/SelectByRegexp
43
43
  end
44
44
 
45
45
  # @return [Symbol]
@@ -13,7 +13,7 @@ module EacConfig
13
13
 
14
14
  class << self
15
15
  def from_uri(uri)
16
- return new(uri.to_addressable.path) if uri.to_addressable.scheme == 'file'
16
+ new(uri.to_addressable.path) if uri.to_addressable.scheme == 'file'
17
17
  end
18
18
  end
19
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-27 00:00:00.000000000 Z
11
+ date: 2024-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '2.8'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 2.8.4
22
+ version: 2.8.6
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,35 +29,35 @@ dependencies:
29
29
  version: '2.8'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 2.8.4
32
+ version: 2.8.6
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: eac_ruby_utils
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.119'
39
+ version: '0.121'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.119'
46
+ version: '0.121'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: eac_ruby_gem_support
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 0.5.1
53
+ version: '0.10'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 0.5.1
60
+ version: '0.10'
61
61
  description:
62
62
  email:
63
63
  executables: []
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
103
  requirements:
104
104
  - - ">="
105
105
  - !ruby/object:Gem::Version
106
- version: '0'
106
+ version: 2.7.0
107
107
  required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - ">="