From 8cdc3778294e77428b05f16ec7a60ff8d1f7775a Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 7 Apr 2004 02:51:05 +0000 Subject: * file.c (rb_get_path): get path string via "to_path" method if path object is not a string. [Ruby2] * gc.c (rb_gc_call_finalizer_at_exit): do not free threads in the exit finalizers. * io.c (rb_io_reopen): should use rb_io_check_io(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/fileutils.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/fileutils.rb') diff --git a/lib/fileutils.rb b/lib/fileutils.rb index b3a146672..c15478ca1 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -717,7 +717,7 @@ module FileUtils end def fu_list(arg) - Array(arg).map {|path| path.to_str } + Array(arg).map {|path| File.path(path) } end def fu_each_src_dest(src, dest) @@ -730,13 +730,15 @@ module FileUtils def fu_each_src_dest0(src, dest) if src.is_a?(Array) src.each do |s| - yield s.to_str, File.join(dest, File.basename(s)) + s = File.path(s) + yield s, File.join(dest, File.basename(s)) end else + src = File.path(src) if File.directory?(dest) - yield src.to_str, File.join(dest, File.basename(src)) + yield src, File.join(dest, File.basename(src)) else - yield src.to_str, dest.to_str + yield src, File.path(dest) end end end -- cgit