helm/rake/rbenv.rake

51 lines
1.1 KiB
Ruby
Raw Normal View History

2014-04-11 00:31:44 -07:00
require_relative 'lib/homebrew'
2014-04-13 08:46:20 -07:00
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
2014-06-20 00:09:03 -07:00
GLOBAL_GEMS = %w{bundler pry rspec rake bluecloth}
2014-04-11 00:31:44 -07:00
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-17 19:28:52 -07:00
task :v2_0 => "rbenv:install" do
2014-04-13 08:46:20 -07:00
v = "2.0.0-p451"
unless Rbenv.is_version_installed?(v)
echo "Building ruby #{v}"
Rbenv.install v, GLOBAL_GEMS
2014-04-11 00:31:44 -07:00
end
2014-04-13 08:46:20 -07:00
end
2014-04-11 00:31:44 -07:00
2014-06-17 19:28:52 -07:00
task :v1_9 => "rbenv:install" do
2014-04-13 08:46:20 -07:00
v = "1.9.3-p545"
unless Rbenv.is_version_installed?(v)
echo "Building ruby #{v}"
Rbenv.install v, GLOBAL_GEMS
end
end
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-04-13 08:46:20 -07:00
Rbenv.installed_versions.each do |v|
echo "Updating ruby #{v}"
Rbenv.update v
2014-04-11 00:31:44 -07:00
end
end
end