config_reader 0.0.2 → 0.0.3
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/History.txt +3 -0
- data/lib/config_reader.rb +4 -5
- data/lib/config_reader/version.rb +1 -1
- metadata +4 -4
data/History.txt
CHANGED
data/lib/config_reader.rb
CHANGED
@@ -25,7 +25,7 @@ class ConfigReader
|
|
25
25
|
def reload
|
26
26
|
raise 'No config file set' unless @config_file
|
27
27
|
|
28
|
-
if defined?(ERB)
|
28
|
+
if defined?(ERB)
|
29
29
|
conf = YAML.load(ERB.new(File.open(find_config).read).result)
|
30
30
|
else
|
31
31
|
conf = YAML.load(File.open(find_config).read)
|
@@ -41,13 +41,12 @@ class ConfigReader
|
|
41
41
|
|
42
42
|
_conf = conf['defaults']
|
43
43
|
_conf.merge(conf[env]) if conf[env]
|
44
|
-
_conf
|
45
44
|
end
|
46
45
|
|
47
46
|
def [](key)
|
48
47
|
config[key]
|
49
48
|
end
|
50
|
-
|
49
|
+
|
51
50
|
def find_config
|
52
51
|
return @config_file if File.exist?(@config_file)
|
53
52
|
|
@@ -56,12 +55,12 @@ class ConfigReader
|
|
56
55
|
return config_file if File.exist?(config_file)
|
57
56
|
end
|
58
57
|
''
|
59
|
-
end
|
58
|
+
end
|
60
59
|
|
61
60
|
def method_missing(key)
|
62
61
|
config[key.to_s] || super
|
63
62
|
end
|
64
|
-
|
63
|
+
|
65
64
|
def inspect
|
66
65
|
puts config.inspect
|
67
66
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: config_reader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Moen
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-12-02 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.
|
23
|
+
version: 1.8.2
|
24
24
|
version:
|
25
25
|
description: Configurations based on environment ala Rails
|
26
26
|
email:
|
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
requirements: []
|
72
72
|
|
73
73
|
rubyforge_project: underpantsgnome
|
74
|
-
rubygems_version: 1.
|
74
|
+
rubygems_version: 1.3.1
|
75
75
|
signing_key:
|
76
76
|
specification_version: 2
|
77
77
|
summary: Configurations based on environment ala Rails
|