Class String
In: lib/rhc/core_ext.rb
Parent: Object

Methods

Classes and Modules

Module String::OpenURI
Class String::Hash

Constants

ANSI_ESCAPE_SEQUENCE = /\e\[(\d{1,2}(?:;\d{1,2})*[@-~])/
ANSI_ESCAPE_MATCH = '\e\[\d+(?:;\d+)*[@-~]'
CHAR_SKIP_ANSI = "(?:(?:#{ANSI_ESCAPE_MATCH})+.?|.(?:#{ANSI_ESCAPE_MATCH})*)"

Public Instance methods

Split the given string at limit, treating ANSI escape sequences as zero characters in length. Will insert an ANSI reset code (\e[0m) at the end of each line containing an ANSI code, assuming that a reset was not in the wrapped segment.

All newlines are preserved.

Lines longer than limit without natural breaks will be forcibly split at the exact limit boundary.

Returns an Array

Wrap string by the given length, and join it with the given character. The method doesn‘t distinguish between words, it will only work based on the length.

[Validate]