config_default 0.6.3 → 0.6.4

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: f5a61fb3d158ea76b892a10aa89b807002afc43b9515e7f73e48e90a0f66a6dd
4
- data.tar.gz: 8de424262c037327175c2fefe5e760fed3cf0cc0bfadba98c839954b222c13c0
3
+ metadata.gz: fc04a9c7d9ef2e4248de491bf01c6c267bd1812aa87d35d8b922b0e4f5316cd1
4
+ data.tar.gz: 6bf8f37f1945dd1cc68b7df225ecc8326afb83e4959b9e858ad9079e2ada33c5
5
5
  SHA512:
6
- metadata.gz: c01a40ddb60363147413fb767a3575e48c0a0174dc870da0ff15a5a5372193fdee1a04d680e82143227fb4633033777137cda720c200e0545daf062675baa674
7
- data.tar.gz: 1c150a29eb09f26539c6e137d6e27186d4c0977b44263d44fa4a58040a6f458350fb11e4dc38afa50229d7452e7007962eebe65ed5c1ca81a06f8c540ea21522
6
+ metadata.gz: eb67890851157ee2279421c1cb5512411a8ce1cd19d01083ade5073486ed64bc0eadb50ff6f60f181690859a6f56a8aa39ee6f9be422c2a784ce13c6dcd64507
7
+ data.tar.gz: af77847870d74d8e0f6752ecc9d683d9efd92b5ee67ea466d97f1b8750eed2fa2c273ec1811c49d235b79c8dcdcffe05aac22d46ed09bfe3143414b09dc69252
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- config_default (0.6.3)
4
+ config_default (0.6.4)
5
5
  activesupport (>= 6)
6
6
 
7
7
  GEM
@@ -18,11 +18,15 @@ class ConfigDefault::Struct
18
18
  @attributes[key]
19
19
  end
20
20
 
21
- def method_missing(method, *_args)
21
+ def method_missing(method_name, *args, &block)
22
22
  return if @allow_nil
23
23
  super
24
24
  end
25
25
 
26
+ def respond_to_missing?(method_name, include_private = false)
27
+ @attributes.key?(method_name) || super
28
+ end
29
+
26
30
  def inspect
27
31
  "#<ConfigDefault::Struct @attributes=#{to_hash} " \
28
32
  "@recursive=#{@recursive} @allow_nil=#{@allow_nil}>"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConfigDefault
4
- VERSION = "0.6.3"
4
+ VERSION = "0.6.4"
5
5
  end
@@ -29,12 +29,13 @@ module ConfigDefault
29
29
  path1 = File.join(config.config_path, "#{name}.#{config.postfix}.yml")
30
30
  path2 = File.join(config.config_path, "#{name}.yml")
31
31
 
32
- unless File.exist?(path1) || File.exist?(path2)
33
- raise Errno::ENOENT.new("#{path1} && #{path2}")
34
- end
32
+ exist1 = File.exist?(path1)
33
+ exist2 = File.exist?(path2)
34
+
35
+ raise Errno::ENOENT.new("#{path1} && #{path2}") unless exist1 || exist2
35
36
 
36
- config1 = File.exist?(path1) ? ActiveSupport::ConfigurationFile.parse(path1) : {}
37
- config2 = File.exist?(path2) ? ActiveSupport::ConfigurationFile.parse(path2) : {}
37
+ config1 = exist1 ? ActiveSupport::ConfigurationFile.parse(path1) : {}
38
+ config2 = exist2 ? ActiveSupport::ConfigurationFile.parse(path2) : {}
38
39
 
39
40
  if key
40
41
  config1 = config1[key] || {}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_default
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stepan Kirushkin