зеркало из https://github.com/github/ruby.git
fileutils.rb: fix error message
* lib/fileutils.rb (FileUtils#mv): show the exact target path in the error message instead of the destination parent directory name. patched by João Britto <jabcalves AT gmail.com> at [ruby-core:68706]. [Bug #11021] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
c6411c6455
Коммит
676fe089bd
|
@ -1,3 +1,10 @@
|
||||||
|
Wed Apr 1 09:59:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/fileutils.rb (FileUtils#mv): show the exact target path in
|
||||||
|
the error message instead of the destination parent directory
|
||||||
|
name. patched by Joao Britto <jabcalves AT gmail.com> at
|
||||||
|
[ruby-core:68706]. [Bug #11021]
|
||||||
|
|
||||||
Tue Mar 31 15:25:07 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
Tue Mar 31 15:25:07 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
||||||
|
|
||||||
* doc/ChangeLog-0.06_to_0.52: added archived Changelog.
|
* doc/ChangeLog-0.06_to_0.52: added archived Changelog.
|
||||||
|
|
|
@ -518,7 +518,7 @@ module FileUtils
|
||||||
begin
|
begin
|
||||||
if destent.exist?
|
if destent.exist?
|
||||||
if destent.directory?
|
if destent.directory?
|
||||||
raise Errno::EEXIST, dest
|
raise Errno::EEXIST, d
|
||||||
else
|
else
|
||||||
destent.remove_file if rename_cannot_overwrite_file?
|
destent.remove_file if rename_cannot_overwrite_file?
|
||||||
end
|
end
|
||||||
|
|
|
@ -416,7 +416,8 @@ class TestFileUtils < Test::Unit::TestCase
|
||||||
|
|
||||||
mkdir 'tmp/tmpdir'
|
mkdir 'tmp/tmpdir'
|
||||||
mkdir_p 'tmp/dest2/tmpdir'
|
mkdir_p 'tmp/dest2/tmpdir'
|
||||||
assert_raise(Errno::EEXIST) {
|
assert_raise_with_message(Errno::EEXIST, %r' - tmp/dest2/tmpdir\z',
|
||||||
|
'[ruby-core:68706] [Bug #11021]') {
|
||||||
mv 'tmp/tmpdir', 'tmp/dest2'
|
mv 'tmp/tmpdir', 'tmp/dest2'
|
||||||
}
|
}
|
||||||
mkdir 'tmp/dest2/tmpdir/junk'
|
mkdir 'tmp/dest2/tmpdir/junk'
|
||||||
|
|
Загрузка…
Ссылка в новой задаче