Created
July 26, 2010 13:54
-
-
Save jonforums/490573 to your computer and use it in GitHub Desktop.
Allow Ruby trunk build with Rubygems
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
diff --git a/config/ruby_installer.rb b/config/ruby_installer.rb | |
index cc18270..c6834c9 100644 | |
--- a/config/ruby_installer.rb | |
+++ b/config/ruby_installer.rb | |
@@ -226,7 +226,7 @@ module RubyInstaller | |
:release => 'official', | |
:version => '1.3.7', | |
:url => 'http://rubyforge.org/frs/download.php/70696', | |
- :checkout => 'http://rubygems.rubyforge.org/svn/trunk', | |
+ :checkout => 'http://github.com/rubygems/rubygems.git', | |
:checkout_target => 'downloads/rubygems', | |
:target => 'sandbox/rubygems', | |
:configure_options => [ | |
diff --git a/recipes/tools/rubygems.rake b/recipes/tools/rubygems.rake | |
index 0c54a1b..b0b973b 100644 | |
--- a/recipes/tools/rubygems.rake | |
+++ b/recipes/tools/rubygems.rake | |
@@ -13,21 +13,23 @@ namespace(:tools) do | |
file_source = "#{package.url}/#{f}" | |
file_target = "downloads/#{f}" | |
download file_target => file_source | |
- | |
+ | |
# depend on downloads directory | |
file file_target => "downloads" | |
- | |
+ | |
# download task need these files as pre-requisites | |
task :download => file_target | |
end | |
task :checkout => "downloads" do | |
cd RubyInstaller::ROOT do | |
- # If is there already a checkout, update instead of checkout" | |
- if File.exist?(File.join(RubyInstaller::ROOT, package.checkout_target, '.svn')) | |
- sh "svn update #{package.checkout_target}" | |
+ # If is there already a checkout, update instead of checkout | |
+ if File.exist?(File.join(RubyInstaller::ROOT, package.checkout_target, '.git')) | |
+ Dir.chdir(package.checkout_target) do | |
+ sh "git checkout master && git pull" | |
+ end | |
else | |
- sh "svn co #{package.checkout} #{package.checkout_target}" | |
+ sh "git clone #{package.checkout} #{package.checkout_target}" | |
end | |
end | |
end | |
@@ -61,11 +63,11 @@ namespace(:tools) do | |
end | |
task :install19 => [package.target, RubyInstaller::Ruby19.target] do | |
- do_install RubyInstaller::RubyGems, RubyInstaller::Ruby19 | |
+ do_install RubyInstaller::RubyGems, RubyInstaller::Ruby19, '--disable-gems' | |
end | |
private | |
- def do_install(package, interpreter) | |
+ def do_install(package, interpreter, *options) | |
new_ruby = File.join(RubyInstaller::ROOT, interpreter.install_target, "bin").gsub(File::SEPARATOR, File::ALT_SEPARATOR) | |
ENV['PATH'] = "#{new_ruby};#{ENV['PATH']}" | |
['RUBYOPT', 'GEM_HOME', 'GEM_PATH'].each do |var| | |
@@ -73,7 +75,7 @@ namespace(:tools) do | |
end | |
cd package.target do | |
- sh "ruby setup.rb install #{package.configure_options.join(' ')}" | |
+ sh "ruby #{options.join(' ')} setup.rb install #{package.configure_options.join(' ')}" | |
end | |
# now fixes the stub batch files form bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment