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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffddca763a36284504ce06cc389c15fb12dfd823
4
- data.tar.gz: 47fde4f5d41ceccf13a910d9b13e2f14beaba9f3
3
+ metadata.gz: da3aafea48ec7fe4756e97f0bb422b9c6ac3ba1f
4
+ data.tar.gz: 9df507d85b57009d91b3fca6573c38bae421cc2e
5
5
  SHA512:
6
- metadata.gz: 2992513481cbabfbef49fe4fd3e67413a6292e800c6305d70025c52c5b885d7e54ccef04ed79872301517cd3558e58e83de352ade7a6c2c89ecf0e3632a67bd2
7
- data.tar.gz: 4dbe149a790b539b24607003e6b744ba81c0e341dd12eb53296822e3f47f22d8451fe516e6bfc88d4708409c2044fd27ea9bc2a387ed8d862de7dd8dc261c38a
6
+ metadata.gz: 1d7cd5af04e0cd6650b7cb8d57d55b468e9a344d044e6516843ef1fb1e7e2decc0675086f48e72c3e23ff609436d3de27217ffc68563167ed0edec2f40e8acd4
7
+ data.tar.gz: bcabe4095d514702c54842f12ad06a31ce39f6a76dcb38b1c5e9ab6d27d9ab3c07ab30800ffa7ab37317c48e9bc69264315111e01b17def3b64d30482602f84d
data/asetus.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'asetus'
3
- s.version = '0.0.7'
3
+ s.version = '0.1.0'
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = [ 'Saku Ytti' ]
6
6
  s.email = %w( saku@ytti.fi )
@@ -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] == '?' # asetus.cfg.foo.bar?
39
+ if name[-1..-1] == '?' # asetus.cfg.foo.bar?
43
40
  if @cfg.has_key? name[0..-2]
44
- @cfg[name[0..-2]] ? true : false
41
+ @cfg[name[0..-2]]
45
42
  else
46
43
  nil
47
44
  end
48
- elsif name[-1..-1] == '=' # asetus.cfg.foo.bar = 'quux'
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 # asetus.cfg.foo.bar
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.7
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-04-15 00:00:00.000000000 Z
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.3
62
+ rubygems_version: 2.0.14
63
63
  signing_key:
64
64
  specification_version: 4
65
65
  summary: configuration library