This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
module Terminal
|
||||
class Table
|
||||
module Util
|
||||
# removes all ANSI escape sequences (e.g. color)
|
||||
def ansi_escape(line)
|
||||
line.to_s.gsub(/\x1b(\[|\(|\))[;?0-9]*[0-9A-Za-z]/, '').
|
||||
gsub(/\x1b(\[|\(|\))[;?0-9]*[0-9A-Za-z]/, '').
|
||||
gsub(/(\x03|\x1a)/, '')
|
||||
end
|
||||
module_function :ansi_escape
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user