Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged: Adding a little tweak to allow the emptying of gemsets, update …
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Extension to empty gemset. | ||
|
||
module Capistrano extend self | ||
Configuration.instance(true).load do | ||
namespace :rvm do | ||
desc "Empty gemset" | ||
task :empty_gemset do | ||
ruby, gemset = rvm_ruby_string.to_s.strip.split /@/ | ||
if %w( release_path default ).include? "#{ruby}" | ||
raise "gemset can not be emptied when using :rvm_ruby_string => :#{ruby}" | ||
else | ||
if gemset | ||
run "#{File.join(rvm_bin_path, "rvm")} #{ruby} do rvm --force gemset empty #{gemset}", :shell => "#{rvm_install_shell}" | ||
end | ||
end | ||
end | ||
end | ||
end if const_defined? :Configuration | ||
end |