cncflora_commons 0.0.11 → 0.0.12
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/lib/cncflora_commons.rb +23 -5
- metadata +1 -1
data/lib/cncflora_commons.rb
CHANGED
@@ -130,11 +130,29 @@ def setup(file)
|
|
130
130
|
|
131
131
|
config = etcd2settings(ENV["ETCD"] || settings.etcd,settings.prefix)
|
132
132
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
config
|
133
|
+
if settings.lang then
|
134
|
+
config[:strings] = JSON.parse(File.read("src/locales/#{settings.lang}.json", :encoding => "BINARY"))
|
135
|
+
end
|
136
|
+
|
137
|
+
if !config.has_key :elasticsearch then
|
138
|
+
config[:elasticsearch] = "#{config[:datahub]}/#{settings.db}"
|
139
|
+
else
|
140
|
+
config[:elasticsearch] = "#{config[:elasticsearch]}/#{settings.db}"
|
141
|
+
end
|
142
|
+
|
143
|
+
if !config.has_key :couchdb then
|
144
|
+
config[:couchdb] = "#{config[:datahub]}/#{settings.db}"
|
145
|
+
else
|
146
|
+
config[:couchdb] = "#{config[:couchdb]}/#{settings.db}"
|
147
|
+
end
|
148
|
+
|
149
|
+
if settings.context then
|
150
|
+
config[:context] = settings.context
|
151
|
+
end
|
152
|
+
|
153
|
+
if settings.base then
|
154
|
+
config[:base] = settings.base
|
155
|
+
end
|
138
156
|
|
139
157
|
config.keys.each { |key| set key, config[key] }
|
140
158
|
end
|