Sha256: f8d792d26929e69b3218d56d89e90c1e023b00c8ffcd5d616b7b5d95ee9dae76

Contents?: true

Size: 142 Bytes

Versions: 1

Compression:

Stored size: 142 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
space-0.0.9 lib/core_ext/string/wrap.rb