asetus 0.0.7 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/asetus.gemspec +1 -1
- data/lib/asetus/configstruct.rb +5 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da3aafea48ec7fe4756e97f0bb422b9c6ac3ba1f
|
4
|
+
data.tar.gz: 9df507d85b57009d91b3fca6573c38bae421cc2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d7cd5af04e0cd6650b7cb8d57d55b468e9a344d044e6516843ef1fb1e7e2decc0675086f48e72c3e23ff609436d3de27217ffc68563167ed0edec2f40e8acd4
|
7
|
+
data.tar.gz: bcabe4095d514702c54842f12ad06a31ce39f6a76dcb38b1c5e9ab6d27d9ab3c07ab30800ffa7ab37317c48e9bc69264315111e01b17def3b64d30482602f84d
|
data/asetus.gemspec
CHANGED
data/lib/asetus/configstruct.rb
CHANGED
@@ -25,10 +25,6 @@ class Asetus
|
|
25
25
|
@cfg.has_key? key
|
26
26
|
end
|
27
27
|
|
28
|
-
def [] key
|
29
|
-
@cfg[key]
|
30
|
-
end
|
31
|
-
|
32
28
|
private
|
33
29
|
|
34
30
|
def initialize hash=nil, opts={}
|
@@ -38,17 +34,18 @@ class Asetus
|
|
38
34
|
|
39
35
|
def method_missing name, *args, &block
|
40
36
|
name = name.to_s
|
37
|
+
name = args.shift if name[0..1] == '[]' # asetus.cfg['foo']
|
41
38
|
arg = args.first
|
42
|
-
if name[-1..-1] == '?'
|
39
|
+
if name[-1..-1] == '?' # asetus.cfg.foo.bar?
|
43
40
|
if @cfg.has_key? name[0..-2]
|
44
|
-
@cfg[name[0..-2]]
|
41
|
+
@cfg[name[0..-2]]
|
45
42
|
else
|
46
43
|
nil
|
47
44
|
end
|
48
|
-
elsif name[-1..-1] == '='
|
45
|
+
elsif name[-1..-1] == '=' # asetus.cfg.foo.bar = 'quux'
|
49
46
|
_asetus_set name[0..-2], arg
|
50
47
|
else
|
51
|
-
_asetus_get name, arg
|
48
|
+
_asetus_get name, arg # asetus.cfg.foo.bar
|
52
49
|
end
|
53
50
|
end
|
54
51
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asetus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saku Ytti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slop
|
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
61
|
rubyforge_project: asetus
|
62
|
-
rubygems_version: 2.0.
|
62
|
+
rubygems_version: 2.0.14
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
65
|
summary: configuration library
|