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

ruby-changes:35068

From: hsbt <ko1@a...>
Date: Tue, 12 Aug 2014 13:36:44 +0900 (JST)
Subject: [ruby-changes:35068] hsbt:r47150 (trunk): * lib/fileutils.rb: enable to remove with non-owner directory.

hsbt	2014-08-12 13:36:31 +0900 (Tue, 12 Aug 2014)

  New Revision: 47150

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

  Log:
    * lib/fileutils.rb: enable to remove with non-owner directory.
      [ruby-dev:45976] [Bug #6756]
    * test/fileutils/test_fileutils.rb: add testcase for #6756.

  Modified files:
    trunk/ChangeLog
    trunk/lib/fileutils.rb
    trunk/test/fileutils/test_fileutils.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47149)
+++ ChangeLog	(revision 47150)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Aug 12 13:34:25 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
+
+	* lib/fileutils.rb: enable to remove with non-owner directory.
+	  [ruby-dev:45976] [Bug #6756]
+	* test/fileutils/test_fileutils.rb: add testcase for #6756.
+
 Tue Aug 12 12:57:28 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
 
 	* vm_exec.c: improve performance in ppc64 arch.
Index: lib/fileutils.rb
===================================================================
--- lib/fileutils.rb	(revision 47149)
+++ lib/fileutils.rb	(revision 47150)
@@ -1489,6 +1489,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1489
           end
         end
       end
+    ensure
       yield self
     end
 
Index: test/fileutils/test_fileutils.rb
===================================================================
--- test/fileutils/test_fileutils.rb	(revision 47149)
+++ test/fileutils/test_fileutils.rb	(revision 47150)
@@ -1499,6 +1499,14 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L1499
 
   def test_rm_rf
     check_singleton :rm_rf
+
+    return if /mswin|mingw/ =~ RUBY_PLATFORM
+
+    mkdir 'tmpdatadir'
+    chmod 700, 'tmpdatadir'
+    rm_rf 'tmpdatadir'
+
+    assert_file_not_exist 'tmpdatadir'
   end
 
   def test_rmdir

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

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