Created
October 8, 2009 05:26
-
-
Save lukemelia/204776 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env ruby | |
source_dir = nil | |
if ARGV[0] == 'ree' | |
source_dir = lambda { |binary| "/opt/ruby-enterprise-1.8.6-20090610/bin/#{binary}" } | |
elsif ARGV[0] == 'mri' | |
source_dir = lambda { |binary| "/usr/bin/#{binary}18" } | |
else | |
raise ArgumentError.new("acceptable args are 'mri' and 'ree'") | |
end | |
%w[erb gem irb rackup rails rake rdoc ri ruby testrb].each do |binary| | |
cmd = "sudo rm /usr/bin/#{binary}" | |
puts cmd | |
puts `#{cmd}` | |
cmd = "sudo ln -s #{source_dir.call(binary)} /usr/bin/#{binary}" | |
puts cmd | |
puts `#{cmd}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment