cncflora_commons 0.0.30 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cncflora_commons.rb +14 -7
- metadata +1 -1
data/lib/cncflora_commons.rb
CHANGED
@@ -81,23 +81,30 @@ def setup(file)
|
|
81
81
|
|
82
82
|
config.each {|ck,cv|
|
83
83
|
ENV.each {|ek,ev|
|
84
|
-
|
84
|
+
if cv =~ /\$#{ek}/ then
|
85
|
+
config[ck] = cv.gsub(/\$#{ek}/,ev)
|
86
|
+
end
|
85
87
|
}
|
86
88
|
}
|
87
89
|
|
88
90
|
ENV.each {|k,v| config[k]=v }
|
89
91
|
|
90
|
-
config
|
92
|
+
if config["lang"] then
|
93
|
+
config["strings"] = JSON.parse(File.read("src/locales/#{config["lang"]}.json", :encoding => "BINARY"))
|
94
|
+
end
|
91
95
|
|
92
|
-
|
96
|
+
if defined? settings then
|
97
|
+
config.each {|k,v| set k.to_sym,v }
|
93
98
|
|
94
|
-
|
95
|
-
set :views, 'src/views'
|
99
|
+
use Rack::Session::Pool
|
96
100
|
|
97
|
-
|
98
|
-
|
101
|
+
set :session_secret, '1flora2'
|
102
|
+
set :views, 'src/views'
|
99
103
|
end
|
100
104
|
|
101
105
|
puts "Config loaded"
|
106
|
+
puts config
|
107
|
+
|
108
|
+
config
|
102
109
|
end
|
103
110
|
|