class String

def tabto(n)

The following methods are lifted from Facets 2.0.2
def tabto(n)
  if self =~ /^( *)\S/
    # Inlined due to collision with ActiveSupport 4.0: indent(n - $1.length)
    m = n - $1.length
    if m >= 0
      gsub(/^/, ' ' * m)
    else
      gsub(/^ {0,#{-m}}/, "")
    end
  else
    self
  end
end