Skip to content

Instantly share code, notes, and snippets.

@nirvdrum
Last active August 29, 2015 14:18
Show Gist options
  • Save nirvdrum/69583f37a88fd1fcd7ee to your computer and use it in GitHub Desktop.
Save nirvdrum/69583f37a88fd1fcd7ee to your computer and use it in GitHub Desktop.
gemfile = File.expand_path(File.join(__FILE__, '..', 'Gemfile'))
if File.exist?(gemfile) && ENV['BUNDLE_GEMFILE'].nil?
puts "Respawning with 'bundle exec'"
exec("bundle", "exec", "cap", *ARGV)
end
load 'deploy'
env = ENV['RUBBER_ENV'] ||= (ENV['RAILS_ENV'] || 'production')
root = ENV['RUBBER_ROOT'] ||= '../mogotest'
# this tries first as a rails plugin then as a gem
$:.unshift "#{root}/vendor/plugins/rubber/lib/"
require 'rubber'
Rubber::initialize(root, env)
require 'rubber/capistrano'
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
require './lib/torquebox-capistrano'
require 'rubber'
ENV['RUBBER_ROOT'] ||= File.join(File.dirname(__FILE__), '..', 'mogotest/')
ENV['RUBBER_ENV'] ||= 'development'
Rubber.initialize(ENV['RUBBER_ROOT'], ENV['RUBBER_ENV'])
require './url_remapper.rb'
run UrlRemapper
# Don't call rubber:config since the configuration is all managed in the "mogotest" project.
callbacks[:after].delete_if { |c| c.source == 'rubber:config' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment