Sha256: 638409b0b35453202ac01a6eff4db0df49e9f2311454f9ab103f5b2ca54d2ed8
Contents?: true
Size: 247 Bytes
Versions: 1
Compression:
Stored size: 247 Bytes
Contents
module LovelyRufus class BasicWrapper < Layer def call wrap unwrapped = wrap.text.tr("\n", ' ').strip wrapped = unwrapped.gsub(/(.{1,#{wrap.width}})( |$\n?)/, "\\1\n") next_layer.call Wrap[wrapped, width: wrap.width] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lovely_rufus-0.1.2 | lib/lovely_rufus/basic_wrapper.rb |