ruby-conf 2.6.3 → 2.6.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.6.3
1
+ 2.6.4
data/lib/ruby-conf.rb CHANGED
@@ -73,7 +73,13 @@ module RubyConf
73
73
  attr_reader :__rc_attributes, :__rc_parent, :__rc_name, :__rc_chains, :__rc_locked
74
74
 
75
75
  def __rc_root() __rc_parent ? __rc_parent.__rc_root : self end
76
- def detach() @__rc_parent = nil; self end
76
+ def detach(parent = nil)
77
+ @__rc_parent = parent
78
+ @__rc_attributes.values.each do |child|
79
+ child.detach(self) if child.is_a?(Config)
80
+ end
81
+ self
82
+ end
77
83
 
78
84
  def initialize(name = nil, parent = nil, &block)
79
85
  @__rc_locked, @__rc_attributes, @__rc_chains, @__rc_parent = false, {}, [], parent
@@ -268,7 +274,7 @@ module RubyConf
268
274
  if Loader::__rc_conf.nil? && (name.nil? || name.to_s =~ /^(?:Rails)?Conf/)
269
275
  default_conf = if ::Object.const_defined?(:Rails)
270
276
  cfg = config[:"#{::Rails.env}"] || config[:"#{::Rails.env}_conf"] || config[:"#{::Rails.env}_config"]
271
- cfg && cfg.detach || config
277
+ (cfg && cfg.detach) || config
272
278
  else
273
279
  config
274
280
  end
data/ruby-conf.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ruby-conf"
8
- s.version = "2.6.3"
8
+ s.version = "2.6.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Curtis Schofield & Hollin Wilkins & Mason"]
@@ -61,17 +61,24 @@ var_args: var|[nil]
61
61
  end
62
62
  end
63
63
  end
64
- other do
64
+ inherit do
65
65
  val "val"
66
+ ival ->{ self.val }
67
+ end
68
+
69
+ other(inherits:inherit) do
66
70
  inner do
67
71
  value "correct"
68
72
  end
69
73
  self_refa ->{ self.inner.value }
70
- self_refb ->{ self.val }
74
+ self_refb ->{ self.ival }
71
75
  end
72
76
  end
73
77
 
74
78
  other = RootTest.other.detach
79
+ other.val.should == "val"
80
+ other.ival.should == "val"
81
+
75
82
  other.inner.value.should == "correct"
76
83
  other.self_refa.should == "correct"
77
84
  other.self_refb.should == "val"
@@ -481,6 +488,7 @@ TEXT
481
488
  bar { ident "wrong" }
482
489
  end
483
490
  RUBY_CONF.ident.should == "correct"
491
+ RUBY_CONF.__rc_parent.should be_nil
484
492
 
485
493
  RubyConf.clear
486
494
  RUBY_CONF.should be_nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-conf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.3
4
+ version: 2.6.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  segments:
117
117
  - 0
118
- hash: -229567439722494491
118
+ hash: -3816343997316263211
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  none: false
121
121
  requirements: