lib/multiruby.rb in zentest-without-autotest-4.2.1 vs lib/multiruby.rb in zentest-without-autotest-4.3.2
- old
+ new
@@ -25,18 +25,15 @@
# mri:svn:releases = alias for supported releases of mri ruby.
# mri:svn:branches = alias for active branches of mri ruby.
# mri:svn:branch:$branch = install a specific $branch of mri from svn.
# mri:svn:tag:$tag = install a specific $tag of mri from svn.
# mri:tar:$version = install a specific $version of mri from tarball.
-# rbx:ln:$dir = symlink your rbx $dir
-# rbx:git:current = install rbx from git
#
# environment variables:
#
# GEM_URL = url for rubygems tarballs
# MRI_SVN = url for MRI SVN
-# RBX_GIT = url for rubinius git
# RUBY_URL = url for MRI tarballs
# VERSIONS = what versions to install
#
# RUBYOPT is cleared on installs.
#
@@ -51,11 +48,10 @@
TAGS = %w( 1_8_6 1_8_7 1_9_1)
BRANCHES = %w(1_8 1_8_6 1_8_7 trunk)
VERSIONS = env('VERSIONS', TAGS.join(":").gsub(/_/, '.')).split(/:/)
MRI_SVN = env 'MRI_SVN', 'http://svn.ruby-lang.org/repos/ruby'
- RBX_GIT = env 'RBX_GIT', 'git://github.com/evanphx/rubinius.git'
RUBY_URL = env 'RUBY_URL', 'http://ftp.ruby-lang.org/pub/ruby'
GEM_URL = env 'GEM_URL', 'http://files.rubyforge.vm.bytemark.co.uk/rubygems'
HELP = []
@@ -156,14 +152,15 @@
end
def self.extract_latest_version url, matching=nil
file = URI.parse(url).read
versions = file.scan(/href="(ruby.*tar.gz)"/).flatten.reject { |s|
- s =~ /preview|-rc\d/
+ s =~ /-rc\d/
}.sort_by { |s|
s.split(/\D+/).map { |i| i.to_i }
}.flatten
+
versions = versions.grep(/#{Regexp.escape(matching)}/) if matching
versions.last
end
def self.fetch_tar v
@@ -264,18 +261,10 @@
def self.rake_build inst_dir
run "rake", "log.build"
FileUtils.ln_sf "../build/#{File.basename Dir.pwd}", inst_dir
end
- def self.rbx_ln dir
- dir = File.expand_path dir
- Multiruby.in_versions_dir do
- FileUtils.ln_sf dir, "rubinius"
- FileUtils.ln_sf "../versions/rubinius", "../install/rubinius"
- end
- end
-
def self.rm name
Multiruby.in_root_dir do
FileUtils.rm_rf Dir["*/#{name}"]
f = "versions/ruby-#{name}.tar.gz"
File.unlink f if test ?f, f
@@ -415,9 +404,13 @@
File.unlink(*Dir["rubygems*"])
File.open file, 'w' do |f|
f.write URI.parse(GEM_URL+"/"+file).read
end
end
+ end
+
+ Multiruby.in_build_dir do
+ FileUtils.rm_rf Dir["rubygems*"]
end
Multiruby.in_install_dir do
FileUtils.rm_rf Dir["*"]
end