config_reader 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.0.3 2008-12-02
2
+ * fix the environment merging issue
3
+
1
4
  == 0.0.2 2008-09-10
2
5
  * have find_config return the file if it exists instead of looking in . and
3
6
  ./config
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
@@ -2,7 +2,7 @@ module ConfigReader
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  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.2
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-09-10 00:00:00 -05:00
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.7.0
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.2.0
74
+ rubygems_version: 1.3.1
75
75
  signing_key:
76
76
  specification_version: 2
77
77
  summary: Configurations based on environment ala Rails