lib/prompts/text_utils.rb in prompts-0.2.0 vs lib/prompts/text_utils.rb in prompts-0.2.1
- old
+ new
@@ -3,11 +3,11 @@
require "unicode/display_width"
require "unicode/emoji"
module Prompts
module TextUtils
- ANSI_REGEX = /\e\[[0-9;]*[a-zA-Z]/.freeze
+ ANSI_REGEX = /\e\[[0-9;]*[a-zA-Z]/
def wrap_text(text, width:, line_prefix: EMPTY, line_suffix: EMPTY, alignment: :left)
words = text.scan(Regexp.union(/\S+/, ANSI_REGEX))
lines = []
line = +EMPTY
@@ -53,6 +53,6 @@
def strip_ansi(text)
text.gsub(ANSI_REGEX, EMPTY)
end
end
-end
\ No newline at end of file
+end