Method: SimpleColor::Utilities#color_strings
- Defined in:
- lib/simplecolor.rb
#color_strings(l, color_regexp: Colorer.regexp(:color)) ⇒ Object
same as above but split into strings
121 122 123 124 125 126 127 |
# File 'lib/simplecolor.rb', line 121 def color_strings(l, color_regexp: Colorer.regexp(:color)) u=l.split(/(#{color_regexp})/) # if we start with an ANSI sequence, u is ["", ...], so we need to # get rid of that "" u.shift if u.first == "" u end |