зеркало из https://github.com/github/ruby.git
FileUtils.rmdir use remove_tailing_slash
* lib/fileutils.rb (FileUtils.rmdir): use remove_tailing_slash. * test/fileutils/test_fileutils.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
935d39a5b8
Коммит
1739ecda3b
|
@ -1,3 +1,8 @@
|
|||
Mon Jun 3 23:58:19 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
|
||||
|
||||
* lib/fileutils.rb (FileUtils.rmdir): use remove_tailing_slash.
|
||||
* test/fileutils/test_fileutils.rb: test for above.
|
||||
|
||||
Mon Jun 3 23:47:55 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (bitlength_bdigit): New function.
|
||||
|
|
|
@ -270,7 +270,7 @@ module FileUtils
|
|||
return if options[:noop]
|
||||
list.each do |dir|
|
||||
begin
|
||||
Dir.rmdir(dir = dir.chomp(?/))
|
||||
Dir.rmdir(dir = remove_tailing_slash(dir))
|
||||
if parents
|
||||
until (parent = File.dirname(dir)) == '.' or parent == dir
|
||||
Dir.rmdir(dir)
|
||||
|
|
|
@ -1221,6 +1221,14 @@ class TestFileUtils
|
|||
|
||||
def test_rmdir
|
||||
check_singleton :rmdir
|
||||
|
||||
begin
|
||||
Dir.rmdir '/'
|
||||
rescue => e
|
||||
assert_raise(e.class) {
|
||||
rmdir '/'
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def test_rmtree
|
||||
|
|
Загрузка…
Ссылка в новой задаче