cncflora_commons 0.0.28 → 0.0.29
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 +7 -2
- metadata +1 -1
data/lib/cncflora_commons.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'uri'
|
2
2
|
require 'json'
|
3
3
|
require 'net/http'
|
4
|
+
require 'yaml'
|
4
5
|
|
5
6
|
def http_get(uri)
|
6
7
|
JSON.parse(Net::HTTP.get(URI(uri)))
|
@@ -74,9 +75,13 @@ def search(db,index,query)
|
|
74
75
|
end
|
75
76
|
|
76
77
|
def setup(file)
|
77
|
-
config_file file
|
78
|
+
#config_file file
|
78
79
|
|
79
|
-
|
80
|
+
config = YAML.load_file(file)[ENV['RACK_ENV'] || 'development']
|
81
|
+
|
82
|
+
ENV.each {|k,v| config[k]=v }
|
83
|
+
|
84
|
+
config.each {|k,v| set k.to_sym,v }
|
80
85
|
|
81
86
|
use Rack::Session::Pool
|
82
87
|
|