Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Quick patch when RACK_ENV is not defined (like pow.cx)

  • Loading branch information...
commit 52357419b83a7ae1ec120f1b72fc92e606e6b08e 1 parent 24cccb9
@allaire authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/base.rb
View
6 lib/base.rb
@@ -176,7 +176,11 @@ def settings
if @@settings.nil?
path = "config/parse_resource.yml"
#environment = defined?(Rails) && Rails.respond_to?(:env) ? Rails.env : ENV["RACK_ENV"]
- environment = ENV["RACK_ENV"]
+ if (!ENV["RACK_ENV"].nil?)
+ environment = ENV["RACK_ENV"]
+ else # Since Pow.cx does not declare RACK_ENV, use development as a fallback
+ environment = "development"
+ end
@@settings = YAML.load(ERB.new(File.new(path).read).result)[environment]
end
@@settings
Please sign in to comment.
Something went wrong with that request. Please try again.