configfiles 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. data/lib/configfiles.rb +4 -2
  2. metadata +6 -4
data/lib/configfiles.rb CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  module ConfigFiles
7
7
 
8
- VERSION = 0.0.1
8
+ VERSION = '0.0.2'
9
9
 
10
10
  module Parser
11
11
  def self.read_file(path)
@@ -43,7 +43,9 @@ module ConfigFiles
43
43
  if converter
44
44
  if converter_block
45
45
  raise ArgumentError, 'you must either specify a symbol or a block'
46
- else
46
+ elsif converter.is_a? Hash
47
+ converter_block = lambda {|x| converter[x]} # x is a String from conf file
48
+ else #Symbol
47
49
  converter_block = lambda {|x| x.method(converter).call}
48
50
  end
49
51
  else
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Guido De Rosa
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-03 00:00:00 +02:00
17
+ date: 2010-09-02 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -39,6 +39,7 @@ rdoc_options: []
39
39
  require_paths:
40
40
  - lib
41
41
  required_ruby_version: !ruby/object:Gem::Requirement
42
+ none: false
42
43
  requirements:
43
44
  - - ">="
44
45
  - !ruby/object:Gem::Version
@@ -46,6 +47,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
47
  - 0
47
48
  version: "0"
48
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
+ none: false
49
51
  requirements:
50
52
  - - ">="
51
53
  - !ruby/object:Gem::Version
@@ -55,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
57
  requirements: []
56
58
 
57
59
  rubyforge_project:
58
- rubygems_version: 1.3.6
60
+ rubygems_version: 1.3.7
59
61
  signing_key:
60
62
  specification_version: 3
61
63
  summary: A simple library to specify the format of configuration files and the way to turn them into Ruby objects.