Skip to content

Instantly share code, notes, and snippets.

@danieljohnmorris
Created May 5, 2010 20:31
Show Gist options
  • Save danieljohnmorris/391381 to your computer and use it in GitHub Desktop.
Save danieljohnmorris/391381 to your computer and use it in GitHub Desktop.
r3 app tpl - load resque
# usage (in app dir):
# rake rails:template LOCATION=http://gist.github.com/391381.txt
gem 'resque', :git => 'git://github.com/defunkt/resque.git'
gem 'resque-scheduler'
file 'config/resque.yml', <<-FILE
development: localhost:6379
test: localhost:6379
staging: redis1.se.github.com:6379
fi: localhost:6379
production: redis1.ae.github.com:6379
FILE
initializer 'resque.rb', <<-FILE
require 'resque'
rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'
rails_env = ENV['RAILS_ENV'] || 'development'
resque_config = YAML.load_file(rails_root + '/config/resque.yml')
Resque.redis = resque_config[rails_env]
FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment