summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/fileutils.rb10
-rw-r--r--lib/pathname.rb2
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index b3a1466726..c15478ca1b 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
diff --git a/lib/pathname.rb b/lib/pathname.rb
index c87a6e91ce..43126aca3c 100644
--- a/lib/pathname.rb
+++ b/lib/pathname.rb
@@ -223,7 +223,7 @@ class Pathname
end
# to_str is implemented so Pathname objects are usable with File.open, etc.
- alias to_str to_s
+ alias to_path to_s
def inspect # :nodoc:
"#<#{self.class}:#{@path}>"