Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 5622daac5e
Fetching contributors…

Cannot retrieve contributors at this time

14 lines (14 sloc) 0.424 kB
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
Jump to Line
Something went wrong with that request. Please try again.