Skip to content

Instantly share code, notes, and snippets.

@etehtsea
Created February 29, 2012 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etehtsea/1941025 to your computer and use it in GitHub Desktop.
Save etehtsea/1941025 to your computer and use it in GitHub Desktop.
heroku ENV
# 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
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