ruby-conf 1.3.0 → 1.4.0
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.
- data/README.rdoc +1 -0
- data/VERSION +1 -1
- data/lib/ruby-conf.rb +8 -0
- data/ruby-conf.gemspec +2 -2
- data/spec/lib/ruby-conf_spec.rb +16 -0
- metadata +4 -4
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.0
|
data/lib/ruby-conf.rb
CHANGED
@@ -9,6 +9,10 @@ class RubyConf
|
|
9
9
|
@attributes = {}
|
10
10
|
end
|
11
11
|
|
12
|
+
def [](name)
|
13
|
+
@attributes[name.to_sym]
|
14
|
+
end
|
15
|
+
|
12
16
|
def method_missing(name, *args, &block)
|
13
17
|
case(args.size)
|
14
18
|
when 0:
|
@@ -67,6 +71,10 @@ class RubyConf
|
|
67
71
|
config
|
68
72
|
end
|
69
73
|
|
74
|
+
def self.[](name)
|
75
|
+
@@configs[name.to_sym]
|
76
|
+
end
|
77
|
+
|
70
78
|
def self.method_missing(name, *args, &block)
|
71
79
|
if @@configs.has_key? name.to_sym
|
72
80
|
@@configs[name.to_sym]
|
data/ruby-conf.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ruby-conf}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.4.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"]
|
12
|
-
s.date = %q{2012-01-
|
12
|
+
s.date = %q{2012-01-27}
|
13
13
|
s.description = %q{rubyconf is a ruby configuration dsl that aims to make it simple to write and read configurations for ruby apps without a yaml or xml file}
|
14
14
|
s.email = %q{blazingpair@blazingcloud.net}
|
15
15
|
s.extra_rdoc_files = [
|
data/spec/lib/ruby-conf_spec.rb
CHANGED
@@ -64,6 +64,22 @@ describe RubyConf do
|
|
64
64
|
MyConfig.turtles.mutant.should == true
|
65
65
|
MyConfig.turtles.raphael.mask.should == "red"
|
66
66
|
end
|
67
|
+
describe "RubyConf" do
|
68
|
+
it "can access configs using square brackets" do
|
69
|
+
subject.define "config" do
|
70
|
+
shredder "villain"
|
71
|
+
end
|
72
|
+
subject[:config].shredder.should == "villain"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
describe "RubyConf::Config" do
|
76
|
+
it "can access attributes using square brackets" do
|
77
|
+
subject.define "config" do
|
78
|
+
splinter "the man"
|
79
|
+
end
|
80
|
+
subject[:config][:splinter].should == "the man"
|
81
|
+
end
|
82
|
+
end
|
67
83
|
it "defines a new configuration with a given name" do
|
68
84
|
subject.define "thing" do end
|
69
85
|
subject.should respond_to(:thing)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-conf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 4
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Curtis Schofield & Hollin Wilkins
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01-
|
18
|
+
date: 2012-01-27 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|