-
-
Notifications
You must be signed in to change notification settings - Fork 77
/
multiruby_setup
executable file
·49 lines (43 loc) · 1.12 KB
/
multiruby_setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env ruby -w
require 'multiruby'
ARGV << "help" if ARGV.empty?
ARGV.each do |spec|
case spec
when "-h", "help" then
Multiruby.help
when "list" then
Multiruby.list
when /rm:(.*)/ then
Multiruby.rm $1
when "clean" then
Multiruby.clean
when "update" then
Multiruby.update
when "update:rubygems" then
Multiruby.update_rubygems
when "mri:svn:current" then
ARGV << "mri:svn:releases" << "mri:svn:branches"
when "mri:svn:releases" then
Multiruby::TAGS.each do |v|
ARGV << "mri:svn:#{v}"
end
when "mri:svn:branches" then
Multiruby::BRANCHES.each do |v|
ARGV << "mri:svn:#{v}"
end
when /mri:svn:branch:(.*)/ then
ver = $1
ver = "branches/ruby_#{ver}" unless ver == "trunk"
Multiruby.svn_co "#{Multiruby::MRI_SVN}/#{ver}", "mri_#{ver}"
when /mri:svn:tag:(.*)/ then
ver = $1
latest = Multiruby.tags.grep(/#{ver}/).last
Multiruby.svn_co "#{Multiruby::MRI_SVN}/tags/#{latest}", "mri_rel_#{ver}"
when /mri:tar:(.*)/ then
v = $1
Multiruby.fetch_tar v
else
warn "unknown spec #{spec}"
end
end
Multiruby.build_and_install