Sha256: c08439a7f60f2027401a1289bb9c3399932c456c650430522d13a02768404a3e

Contents?: true

Size: 137 Bytes

Versions: 5

Compression:

Stored size: 137 Bytes

Contents

class String
  def wrap(width)
    gsub(/(.{1,#{width}})( +|$\n?)|(.{1,#{width}})/, "\\1\\3\n")
  end unless method_defined?(:wrap)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
space-0.0.8 lib/core_ext/string/wrap.rb
space-0.0.7 lib/core_ext/string/wrap.rb
space-0.0.6 lib/core_ext/string/wrap.rb
space-0.0.5 lib/core_ext/string/wrap.rb
space-0.0.4 lib/core_ext/string/wrap.rb