Sha256: 78cca4ba4001129c5b2190101a92e4f80d7e6f860e6b96297932a1f92570b4f7

Contents?: true

Size: 266 Bytes

Versions: 4

Compression:

Stored size: 266 Bytes

Contents

module Nanoc::CLI::StreamCleaners
  # Removes ANSI color escape sequences.
  #
  # @api private
  class ANSIColors < Abstract
    # @see Nanoc::CLI::StreamCleaners::Abstract#clean
    def clean(s)
      s.is_a?(String) ? s.gsub(/\e\[.+?m/, '') : s
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nanoc-4.1.0rc2 lib/nanoc/cli/stream_cleaners/ansi_colors.rb
nanoc-4.1.0rc1 lib/nanoc/cli/stream_cleaners/ansi_colors.rb
nanoc-4.1.0b1 lib/nanoc/cli/stream_cleaners/ansi_colors.rb
nanoc-4.1.0a1 lib/nanoc/cli/stream_cleaners/ansi_colors.rb