summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-22 07:12:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-22 07:12:22 +0000
commitfba1063c5f6f4a1b2b10d6bebfc443eb94a36943 (patch)
tree302a9cb29fd38c659262f46eff6c48f02cb23360 /tool
parenta58c76cc204b4e0824b5701f1b4ef3b7cf2f86e4 (diff)
* tool/rbinstall.rb (strip_file): accept an array of path names.
* tool/rbinstall.rb (install): allow multiple path names. [ruby-core:38379] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/rbinstall.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 967effab8c..27d716bcde 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -136,7 +136,7 @@ def install?(*types, &block)
end
end
-def strip_file(file)
+def strip_file(files)
if !defined?($strip_command) and (cmd = CONFIG["STRIP"])
case cmd
when "", "true", ":" then return
@@ -145,7 +145,7 @@ def strip_file(file)
elsif !$strip_command
return
end
- system(*($strip_command + [file]))
+ system(*($strip_command + [files].flatten))
end
def install(src, dest, options = {})
@@ -154,12 +154,13 @@ def install(src, dest, options = {})
options[:preserve] = true
d = with_destdir(dest)
super(src, d, options)
+ srcs = Array(src)
if strip
- d = File.join(d, File.basename(src)) if $made_dirs[dest]
+ d = srcs.map {|src| File.join(d, File.basename(src))} if $made_dirs[dest]
strip_file(d)
end
if $installed_list
- dest = File.join(dest, File.basename(src)) if $made_dirs[dest]
+ dest = srcs.map {|src| File.join(dest, File.basename(src))} if $made_dirs[dest]
$installed_list.puts dest
end
end
@@ -570,10 +571,8 @@ end
bin_dir = File.join(gem_dir, 'gems', full_name, 'bin')
makedirs(bin_dir)
- execs.each do |exec|
- exec = File.join(srcdir, 'bin', exec)
- install(exec, bin_dir, :mode => $prog_mode)
- end
+ execs = execs.map {|exec| File.join(srcdir, 'bin', exec)}
+ install(execs, bin_dir, :mode => $prog_mode)
end
end
end