[前][次][番号順一覧][スレッド一覧]

ruby-changes:20568

From: nobu <ko1@a...>
Date: Fri, 22 Jul 2011 16:14:40 +0900 (JST)
Subject: [ruby-changes:20568] nobu:r32616 (trunk): * tool/rbinstall.rb (strip_file): accept an array of path names.

nobu	2011-07-22 16:12:22 +0900 (Fri, 22 Jul 2011)

  New Revision: 32616

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32616

  Log:
    * tool/rbinstall.rb (strip_file): accept an array of path names.
    * tool/rbinstall.rb (install): allow multiple path names.
      [ruby-core:38379]

  Modified files:
    trunk/tool/rbinstall.rb

Index: tool/rbinstall.rb
===================================================================
--- tool/rbinstall.rb	(revision 32615)
+++ tool/rbinstall.rb	(revision 32616)
@@ -136,7 +136,7 @@
   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 @@
   elsif !$strip_command
     return
   end
-  system(*($strip_command + [file]))
+  system(*($strip_command + [files].flatten))
 end
 
 def install(src, dest, options = {})
@@ -154,12 +154,13 @@
   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 @@
       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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]