2014-07-17 05:11:18 -07:00
|
|
|
require_relative '../lib/homebrew'
|
|
|
|
require_relative '../lib/rbenv'
|
2014-04-11 00:31:44 -07:00
|
|
|
|
2014-04-13 08:46:20 -07:00
|
|
|
task :rbenv => 'rbenv:update'
|
2014-04-11 00:31:44 -07:00
|
|
|
|
|
|
|
namespace :rbenv do
|
|
|
|
|
|
|
|
task :install do
|
2014-04-13 08:46:20 -07:00
|
|
|
unless Rbenv.is_installed?
|
|
|
|
echo "Installing rbenv"
|
|
|
|
Rbenv.bootstrap
|
|
|
|
end
|
2014-04-11 00:31:44 -07:00
|
|
|
end
|
|
|
|
|
2014-06-20 00:09:22 -07:00
|
|
|
task :remove do
|
|
|
|
if Rbenv.is_installed?
|
|
|
|
echo "rbenv isn't installed!"
|
|
|
|
else
|
2014-04-13 08:46:20 -07:00
|
|
|
echo "Deleting rbenv"
|
|
|
|
Rbenv.destroy
|
|
|
|
end
|
|
|
|
end
|
2014-04-11 00:31:44 -07:00
|
|
|
|
2014-06-17 19:28:52 -07:00
|
|
|
task :update => "rbenv:install" do
|
2014-08-21 00:29:03 -07:00
|
|
|
Rbenv.installed_versions.each do |v|
|
2014-04-13 08:46:20 -07:00
|
|
|
echo "Updating ruby #{v}"
|
|
|
|
Rbenv.update v
|
2014-04-11 00:31:44 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|