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.
Files changed (2) hide show
  1. data/lib/cncflora_commons.rb +23 -5
  2. metadata +1 -1
@@ -130,11 +130,29 @@ def setup(file)
130
130
 
131
131
  config = etcd2settings(ENV["ETCD"] || settings.etcd,settings.prefix)
132
132
 
133
- config[:strings] = JSON.parse(File.read("src/locales/#{settings.lang}.json", :encoding => "BINARY"))
134
- config[:elasticsearch] = "#{config[:datahub]}/#{settings.db}"
135
- config[:couchdb] = "#{ config[:datahub] }/#{settings.db}"
136
- config[:context] = settings.context
137
- config[:base] = settings.base
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cncflora_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: