Sha256: 6190ec79d8eb001d7eed2fa94b57cdcf744d038f2ce3ae9f1a9f286f9ddc1207

Contents?: true

Size: 242 Bytes

Versions: 2

Compression:

Stored size: 242 Bytes

Contents

# encoding: utf-8

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nanoc-3.8.0 lib/nanoc/cli/stream_cleaners/ansi_colors.rb
nanoc-3.7.5 lib/nanoc/cli/stream_cleaners/ansi_colors.rb