cncflora_commons 0.0.34 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cncflora_commons.rb +8 -8
- metadata +1 -1
data/lib/cncflora_commons.rb
CHANGED
@@ -79,6 +79,14 @@ def setup(file)
|
|
79
79
|
|
80
80
|
@config = YAML.load_file(file)[ENV['RACK_ENV'] || 'development']
|
81
81
|
|
82
|
+
@config.each {|ck,cv|
|
83
|
+
ENV.each {|ek,ev|
|
84
|
+
if cv =~ /\$#{ek}/ then
|
85
|
+
@config[ck] = cv.gsub(/\$#{ek}/,ev)
|
86
|
+
end
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
82
90
|
if @config["etcd"] || ENV["ETCD"] then
|
83
91
|
etcd_cfg = etcd2config(@config["etcd"] || ENV["ETCD"])
|
84
92
|
onchange(@config["etcd"] || ENV["ETCD"]) do |newconfig|
|
@@ -90,14 +98,6 @@ def setup(file)
|
|
90
98
|
etcd_cfg.each {|k,v| @config[k] = v }
|
91
99
|
end
|
92
100
|
|
93
|
-
@config.each {|ck,cv|
|
94
|
-
ENV.each {|ek,ev|
|
95
|
-
if cv =~ /\$#{ek}/ then
|
96
|
-
@config[ck] = cv.gsub(/\$#{ek}/,ev)
|
97
|
-
end
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
101
101
|
ENV.each {|k,v| @config[k]=v }
|
102
102
|
|
103
103
|
if @config["lang"] then
|