cncflora_commons 0.0.28 → 0.0.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/cncflora_commons.rb +7 -2
  2. metadata +1 -1
@@ -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
- ENV.each {|k,v| set k.to_sym, v}
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
 
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.28
4
+ version: 0.0.29
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: