config_context 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/config_context.rb +3 -2
- data/lib/version.rb +1 -1
- data/test/unit/tc_config_context.rb +1 -1
- metadata +13 -2
data/lib/config_context.rb
CHANGED
@@ -10,14 +10,15 @@ module ConfigContext
|
|
10
10
|
|
11
11
|
def method_missing( method, *arguments, &block )
|
12
12
|
|
13
|
-
if( method =~ /(.+)=$/ )
|
13
|
+
if( method.to_s =~ /(.+)=$/ )
|
14
14
|
|
15
15
|
config_key = method.to_s.delete( '=' ).to_sym
|
16
16
|
@config[config_key] = (arguments.length == 1) ? arguments[0] : arguments
|
17
|
-
elsif( method =~ /(.+)\?$/ )
|
17
|
+
elsif( method.to_s =~ /(.+)\?$/ )
|
18
18
|
|
19
19
|
@config.has_key?( method.to_s.delete( '?' ).to_sym )
|
20
20
|
else
|
21
|
+
|
21
22
|
@config[method] if @config.has_key?( method )
|
22
23
|
end
|
23
24
|
end
|
data/lib/version.rb
CHANGED
@@ -66,7 +66,7 @@ class TestConfigContext < Test::Unit::TestCase
|
|
66
66
|
|
67
67
|
should "retrieve all property keys" do
|
68
68
|
|
69
|
-
assert_equal( ConfigContext.keys, [ :mysymbol, :mylist, :myhash, 'string'
|
69
|
+
assert_equal( ConfigContext.keys, [ :mysymbol, :mylist, :myhash, :othersymbol, 'string' ] )
|
70
70
|
end
|
71
71
|
|
72
72
|
should "load a Yaml file without keys collisions" do
|
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: config_context
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 17
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- Javier Juarez
|
@@ -10,7 +15,7 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-28 00:00:00 +02:00
|
14
19
|
default_executable:
|
15
20
|
dependencies: []
|
16
21
|
|
@@ -41,12 +46,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
41
46
|
requirements:
|
42
47
|
- - ">="
|
43
48
|
- !ruby/object:Gem::Version
|
49
|
+
hash: 3
|
50
|
+
segments:
|
51
|
+
- 0
|
44
52
|
version: "0"
|
45
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
54
|
none: false
|
47
55
|
requirements:
|
48
56
|
- - ">="
|
49
57
|
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
50
61
|
version: "0"
|
51
62
|
requirements: []
|
52
63
|
|