Sha256: 12ed8aa9d80509e95755517040d229140592feb72840e9fa4619217c1fbe63ce
Contents?: true
Size: 286 Bytes
Versions: 17
Compression:
Stored size: 286 Bytes
Contents
require 'facets/string/indent' class String # Preserves relative tabbing. # The first non-empty line ends up with n spaces before nonspace. # # CREDIT: Gavin Sinclair def tabto(n) if self =~ /^( *)\S/ indent(n - $1.length) else self end end end
Version data entries
17 entries across 16 versions & 1 rubygems