Sha256: d806a45e626d4882f38a04171d69d299fce4c8af5b8924252125083c7841b569

Contents?: true

Size: 275 Bytes

Versions: 25

Compression:

Stored size: 275 Bytes

Contents

# frozen_string_literal: true

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

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
nanoc-4.7.14 lib/nanoc/cli/stream_cleaners/ansi_colors.rb
nanoc-4.7.13 lib/nanoc/cli/stream_cleaners/ansi_colors.rb
nanoc-4.7.12 lib/nanoc/cli/stream_cleaners/ansi_colors.rb
nanoc-4.7.11 lib/nanoc/cli/stream_cleaners/ansi_colors.rb
nanoc-4.7.10 lib/nanoc/cli/stream_cleaners/ansi_colors.rb