Files
news.gitea.happylizard.me/bin/gems/terminal-table-3.0.2/lib/terminal-table/util.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

14 lines
348 B
Ruby

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