Sha256: fba55f5dc6d209937fca9af5695a078434813a4636ded478eabd2017f0ebc7d6

Contents?: true

Size: 399 Bytes

Versions: 51

Compression:

Stored size: 399 Bytes

Contents

module Nanoc::CLI::StreamCleaners
  # Simplifies output by replacing UTF-8 characters with their ASCII decompositions.
  #
  # @api private
  class UTF8 < Abstract
    # @see Nanoc::CLI::StreamCleaners::Abstract#clean
    def clean(s)
      # FIXME: this decomposition is not generally usable
      s.gsub(/“|”/, '"').gsub(/‘|’/, '\'').gsub('…', '...').gsub('©', '(c)')
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
nanoc-4.6.3 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.6.2 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.6.1 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.6.0 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.5.4 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.5.3 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.5.2 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.5.1 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.5.0 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.4.7 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.4.6 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.4.5 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.4.4 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.4.3 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.4.2 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.4.1 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.4.0 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.3.8 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.3.7 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.3.6 lib/nanoc/cli/stream_cleaners/utf8.rb