Sha256: d1746993351bfda3151760623feed051b8c24f16ae8aad6a8f3cbf57e80a550d
Contents?: true
Size: 424 Bytes
Versions: 50
Compression:
Stored size: 424 Bytes
Contents
module REXML module Formatters class Pretty < Default private def wrap(string, width) # Recursivly wrap string at width. return string if string.length <= width place = string.rindex(/\s+/, width) # Position in string with last ' ' before cutoff return string if place.nil? return string[0,place] + "\n" + wrap(string[place+1..-1], width) end end end end
Version data entries
50 entries across 50 versions & 3 rubygems