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

ruby-changes:39609

From: nobu <ko1@a...>
Date: Wed, 26 Aug 2015 17:12:18 +0900 (JST)
Subject: [ruby-changes:39609] nobu:r51690 (trunk): test_fileutils.rb: improve my_rm_rf

nobu	2015-08-26 17:11:58 +0900 (Wed, 26 Aug 2015)

  New Revision: 51690

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

  Log:
    test_fileutils.rb: improve my_rm_rf
    
    * test/fileutils/test_fileutils.rb (my_rm_rf): get rid of special
      chars and remove by rmdir on Windows.

  Modified files:
    trunk/test/fileutils/test_fileutils.rb
Index: test/fileutils/test_fileutils.rb
===================================================================
--- test/fileutils/test_fileutils.rb	(revision 51689)
+++ test/fileutils/test_fileutils.rb	(revision 51690)
@@ -123,7 +123,9 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L123
 
   def my_rm_rf(path)
     if File.exist?('/bin/rm')
-      system %Q[/bin/rm -rf "#{path}"]
+      system "/bin/rm", "-rf", path
+    elsif /mswin|mingw/ =~ RUBY_PLATFORM
+      system "rmdir", "/q/s", path.gsub('/', '\\'), err: IO::NULL
     else
       FileUtils.rm_rf path
     end

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

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