Skip to content

Instantly share code, notes, and snippets.

@motdotla
Forked from richievos/bundler_cap.rb
Created December 14, 2009 19:09
Show Gist options
  • Save motdotla/256317 to your computer and use it in GitHub Desktop.
Save motdotla/256317 to your computer and use it in GitHub Desktop.
namespace :bundler do
desc 'bundler install'
task :install do
run("gem install bundler --source=http://gemcutter.org")
end
desc 'bundler symlink vendor'
task :symlink_vendor do
shared_gems = File.join(shared_path, 'vendor/bundler_gems')
release_gems = "#{release_path}/vendor/bundler_gems/"
%w(cache gems specifications).each do |sub_dir|
shared_sub_dir = File.join(shared_gems, sub_dir)
run("mkdir -p #{shared_sub_dir} && mkdir -p #{release_gems} && ln -s #{shared_sub_dir} #{release_gems}/#{sub_dir}")
end
end
desc 'bundler new release'
task :bundle_new_release do
bundler.symlink_vendor
run("cd #{release_path} && gem bundle --only #{rails_env}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment