# File lib/pathname.rb, line 253
  def sub(pattern, *rest, &block)
    self.class.new(@path.sub(pattern, *rest, &block))
  end