diretory.patch

Akira Matsuda, 11/30/2013 12:28 AM

Download (1.06 KB)

View differences:

lib/fileutils.rb
1362 1362
      when file?
1363 1363
        copy_file dest
1364 1364
      when directory?
1365
        if !File.exist?(dest) and descendant_diretory?(dest, path)
1365
        if !File.exist?(dest) and descendant_directory?(dest, path)
1366 1366
          raise ArgumentError, "cannot copy directory %s to itself %s" % [path, dest]
1367 1367
        end
1368 1368
        begin
......
1557 1557
    end
1558 1558
    SYSCASE = File::FNM_SYSCASE.nonzero? ? "-i" : ""
1559 1559

  
1560
    def descendant_diretory?(descendant, ascendant)
1560
    def descendant_directory?(descendant, ascendant)
1561 1561
      /\A(?#{SYSCASE}:#{Regexp.quote(ascendant)})#{DIRECTORY_TERM}/ =~ File.dirname(descendant)
1562 1562
    end
1563 1563
  end   # class Entry_
1564
-