Created
February 29, 2012 13:56
-
-
Save etehtsea/1941025 to your computer and use it in GitHub Desktop.
heroku ENV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example 5-18. | |
$LOAD_PATH.unshift 'lib' | |
require 'blog' | |
#if ENV['URL'] and ENV['DATABASE_URL'] | |
if ENV['HOME'] == '/app' | |
# we're on heroku, no cache needed | |
# also, it's a read-only file system | |
GithubHook.disable :autopull | |
elsif Blog.production? | |
require 'rack/cache' use Rack::Cache | |
end | |
run Blog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):004:0> ENV['URL'] | |
=> nil | |
irb(main):005:0> ENV['DATABASE_URL'] | |
=> nil | |
irb(main):006:0> ENV['HOME'] | |
=> "/app" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment