eac_config 0.14.1 → 0.14.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: 7129c57e10676ddf2fd7b418aa21de384634e1ee9a3b1b5086524f62fa2a84fd
4
- data.tar.gz: 61af2046de4dd5d3325fe1719b7ddb3e62e4134497a20ef0b923ceb5ebabee65
3
+ metadata.gz: 496112538fc45570313afdec975bc75e76a610ea2840e29559b0e08943cd8674
4
+ data.tar.gz: 66720801251f13ced19a4604f8594612925e10e157778fb7bfb546f8fb6fa984
5
5
  SHA512:
6
- metadata.gz: 6f04f61ae7c90c57ed1fbc492a894ccf525fe8aa47ebbf6dbe665fd0289615d67c66b2f09b3f99f51b5b72c7a2961da7971ec74139a9f25773548bd70a3e2ed7
7
- data.tar.gz: b4284d78053b22cf34e9134d3d1529b0079d46cfca98ebb3ae7abefd87062f019c1e9acf46ad9173517457e4c3c8a09b0b894237d8d9b9b1d7ac9b6caeec03a8
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.1'
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.1
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-10-24 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.5
22
+ version: 2.8.6
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,41 +29,35 @@ dependencies:
29
29
  version: '2.8'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 2.8.5
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'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 0.119.2
39
+ version: '0.121'
43
40
  type: :runtime
44
41
  prerelease: false
45
42
  version_requirements: !ruby/object:Gem::Requirement
46
43
  requirements:
47
44
  - - "~>"
48
45
  - !ruby/object:Gem::Version
49
- version: '0.119'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 0.119.2
46
+ version: '0.121'
53
47
  - !ruby/object:Gem::Dependency
54
48
  name: eac_ruby_gem_support
55
49
  requirement: !ruby/object:Gem::Requirement
56
50
  requirements:
57
51
  - - "~>"
58
52
  - !ruby/object:Gem::Version
59
- version: 0.5.1
53
+ version: '0.10'
60
54
  type: :development
61
55
  prerelease: false
62
56
  version_requirements: !ruby/object:Gem::Requirement
63
57
  requirements:
64
58
  - - "~>"
65
59
  - !ruby/object:Gem::Version
66
- version: 0.5.1
60
+ version: '0.10'
67
61
  description:
68
62
  email:
69
63
  executables: []
@@ -109,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
103
  requirements:
110
104
  - - ">="
111
105
  - !ruby/object:Gem::Version
112
- version: '0'
106
+ version: 2.7.0
113
107
  required_rubygems_version: !ruby/object:Gem::Requirement
114
108
  requirements:
115
109
  - - ">="