ruby-conf 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use ruby-1.8.7-p370@rubyconf --create
1
+ rvm use ruby-1.9.3-p194@rubyconf --create
data/Gemfile CHANGED
@@ -10,7 +10,5 @@ group :development do
10
10
  gem "rr", "~> 1.0.4"
11
11
  gem "yard", "~> 0.7"
12
12
  gem "rdoc", "~> 3.12"
13
- gem "bundler", "~> 1.0.0"
14
13
  gem "jeweler", "~> 1.8.3"
15
- gem "rcov", ">= 0"
16
14
  end
data/Gemfile.lock CHANGED
@@ -10,7 +10,6 @@ GEM
10
10
  rdoc
11
11
  json (1.6.5)
12
12
  rake (0.9.2.2)
13
- rcov (1.0.0)
14
13
  rdoc (3.12)
15
14
  json (~> 1.4)
16
15
  rr (1.0.4)
@@ -28,9 +27,7 @@ PLATFORMS
28
27
  ruby
29
28
 
30
29
  DEPENDENCIES
31
- bundler (~> 1.0.0)
32
30
  jeweler (~> 1.8.3)
33
- rcov
34
31
  rdoc (~> 3.12)
35
32
  rr (~> 1.0.4)
36
33
  rspec (~> 2.8.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.1.0
data/lib/ruby-conf.rb CHANGED
@@ -13,6 +13,7 @@ class RubyConf < Object
13
13
  attr_reader :__rc_attributes, :__rc_parent, :__rc_name, :__rc_chains, :__rc_locked
14
14
 
15
15
  def __rc_root() __rc_parent ? __rc_parent.__rc_root : self end
16
+ def detach() @__rc_parent = nil; self end
16
17
 
17
18
  def initialize(name = nil, parent = nil, &block)
18
19
  @__rc_locked, @__rc_attributes, @__rc_chains, @__rc_parent = false, {}, [], parent
@@ -48,12 +49,12 @@ class RubyConf < Object
48
49
  @__rc_attributes[name.to_sym] = value
49
50
  end
50
51
 
51
- def __rc_set_default(conf, key, value)
52
+ def __rc_set_defaults(conf, key, value)
52
53
  if conf.__rc_attributes.key?(key)
53
54
  if value.is_a?(Config)
54
55
  sub = conf.__rc_attributes[key]
55
56
  value.__rc_attributes.each do |k, v|
56
- __rc_set_default(sub, k, v)
57
+ __rc_set_defaults(sub, k, v)
57
58
  end
58
59
  end
59
60
  else
@@ -70,7 +71,7 @@ class RubyConf < Object
70
71
  self[name] = [*options[:inherits]].inject(Config.new(name, self, &block)) do |conf, inherited|
71
72
  inherited = self[inherited.to_sym] unless inherited.is_a?(Config)
72
73
  __rc_copy(inherited.__rc_attributes).each do |key, value|
73
- __rc_set_default(conf, key, value)
74
+ __rc_set_defaults(conf, key, value)
74
75
  end
75
76
  conf
76
77
  end
@@ -105,9 +106,7 @@ class RubyConf < Object
105
106
  args = args.size == 1 ? args.first : args
106
107
  (@__rc_locked && __rc_attributes[name.to_sym].is_a?(Proc)) ? self[name, args] : self[name] = args
107
108
  end
108
-
109
109
  end
110
-
111
110
  end
112
111
 
113
112
  def respond_to?(name)
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.0.0"
8
+ s.version = "2.1.0"
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"]
@@ -45,26 +45,20 @@ Gem::Specification.new do |s|
45
45
  s.add_development_dependency(%q<rr>, ["~> 1.0.4"])
46
46
  s.add_development_dependency(%q<yard>, ["~> 0.7"])
47
47
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
48
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
49
48
  s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
50
- s.add_development_dependency(%q<rcov>, [">= 0"])
51
49
  else
52
50
  s.add_dependency(%q<rspec>, ["~> 2.8.0"])
53
51
  s.add_dependency(%q<rr>, ["~> 1.0.4"])
54
52
  s.add_dependency(%q<yard>, ["~> 0.7"])
55
53
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
56
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
57
54
  s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
58
- s.add_dependency(%q<rcov>, [">= 0"])
59
55
  end
60
56
  else
61
57
  s.add_dependency(%q<rspec>, ["~> 2.8.0"])
62
58
  s.add_dependency(%q<rr>, ["~> 1.0.4"])
63
59
  s.add_dependency(%q<yard>, ["~> 0.7"])
64
60
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
65
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
66
61
  s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
67
- s.add_dependency(%q<rcov>, [">= 0"])
68
62
  end
69
63
  end
70
64
 
@@ -49,6 +49,15 @@ describe RubyConf do
49
49
  RootTest.outer.middle.__rc_root == RootTest
50
50
  RootTest.outer.middle.inner.__rc_root.should == RootTest
51
51
 
52
+ RootTest.outer.detach
53
+ RootTest.outer.__rc_root.should == RootTest.outer
54
+ RootTest.outer.middle.__rc_root == RootTest.outer
55
+ RootTest.outer.middle.inner.__rc_root.should == RootTest.outer
56
+
57
+ RootTest.outer.middle.detach
58
+ RootTest.outer.middle.__rc_root == RootTest.outer.middle
59
+ RootTest.outer.middle.inner.__rc_root.should == RootTest.outer.middle
60
+
52
61
  end
53
62
 
54
63
  it "sets self properly in nested procs" do
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.0.0
4
+ version: 2.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -75,22 +75,6 @@ dependencies:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
77
  version: '3.12'
78
- - !ruby/object:Gem::Dependency
79
- name: bundler
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ~>
84
- - !ruby/object:Gem::Version
85
- version: 1.0.0
86
- type: :development
87
- prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ~>
92
- - !ruby/object:Gem::Version
93
- version: 1.0.0
94
78
  - !ruby/object:Gem::Dependency
95
79
  name: jeweler
96
80
  requirement: !ruby/object:Gem::Requirement
@@ -107,22 +91,6 @@ dependencies:
107
91
  - - ~>
108
92
  - !ruby/object:Gem::Version
109
93
  version: 1.8.3
110
- - !ruby/object:Gem::Dependency
111
- name: rcov
112
- requirement: !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
115
- - - ! '>='
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ! '>='
124
- - !ruby/object:Gem::Version
125
- version: '0'
126
94
  description: rubyconf is a ruby configuration dsl that aims to make it simple to write
127
95
  and read configurations for ruby apps without a yaml or xml file
128
96
  email: blazingpair@blazingcloud.net
@@ -160,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
128
  version: '0'
161
129
  segments:
162
130
  - 0
163
- hash: -2251850668776804598
131
+ hash: 2592500136746080662
164
132
  required_rubygems_version: !ruby/object:Gem::Requirement
165
133
  none: false
166
134
  requirements: