Sha256: 9b2b49913e82efb6ca7e244495ff0e5f1a74ce644183fd1b6de592afbc9dd4ff
Contents?: true
Size: 352 Bytes
Versions: 4
Compression:
Stored size: 352 Bytes
Contents
require_relative '../wrap' require_relative 'layer' module LovelyRufus module Layers 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 end
Version data entries
4 entries across 4 versions & 1 rubygems