From 86c01304de70c790c3f7448716184840b824b0c3 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Sat, 30 Nov 2013 00:18:44 +0900 Subject: [PATCH] diretory --- lib/fileutils.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 26129c4..c66511f 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1362,7 +1362,7 @@ module FileUtils when file? copy_file dest when directory? - if !File.exist?(dest) and descendant_diretory?(dest, path) + if !File.exist?(dest) and descendant_directory?(dest, path) raise ArgumentError, "cannot copy directory %s to itself %s" % [path, dest] end begin @@ -1557,7 +1557,7 @@ module FileUtils end SYSCASE = File::FNM_SYSCASE.nonzero? ? "-i" : "" - def descendant_diretory?(descendant, ascendant) + def descendant_directory?(descendant, ascendant) /\A(?#{SYSCASE}:#{Regexp.quote(ascendant)})#{DIRECTORY_TERM}/ =~ File.dirname(descendant) end end # class Entry_ -- 1.8.4.3