Sha256: 2421ffdebaf247a3fe0452eb78ab69d398fa1e27d7b74f6e4b5664ac26257d23
Contents?: true
Size: 236 Bytes
Versions: 3
Compression:
Stored size: 236 Bytes
Contents
module LovelyRufus class OneLetterGluer < Layer def call wrap pattern = /(?<=\p{space})(&|\p{letter})\p{space}/ text = wrap.text.gsub pattern, "\\1\\2#{NBSP}" next_layer.call Wrap[text, width: wrap.width] end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
lovely_rufus-0.1.2 | lib/lovely_rufus/one_letter_gluer.rb |
lovely_rufus-0.1.1 | lib/lovely_rufus/one_letter_gluer.rb |
lovely_rufus-0.1.0 | lib/lovely_rufus/one_letter_gluer.rb |