Sha256: b57ec86831b43aea999c3979b65afd17c48b9d2b6ade65811918dc8083367ea6

Contents?: true

Size: 429 Bytes

Versions: 14

Compression:

Stored size: 429 Bytes

Contents

module CodeRay
module Encoders

  class Text < Encoder

    include Streamable
    register_for :text

    FILE_EXTENSION = 'txt'

    DEFAULT_OPTIONS = {
      :separator => ''
    }

  protected
    def setup options
      @out = ''
      @sep = options[:separator]
    end

    def token text, kind
      @out << text + @sep if text.is_a? ::String
    end

    def finish options
      @out.chomp @sep
    end

  end

end
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
raldred-coderay-0.9.339 ./lib/coderay/encoders/text.rb
raldred-coderay-0.9.3391 ./lib/coderay/encoders/text.rb
raldred-coderay-0.9.3431 ./lib/coderay/encoders/text.rb
coderay-0.8.357 ./lib/coderay/encoders/text.rb
coderay-0.8.263 ./lib/coderay/encoders/text.rb
coderay-0.8.270 ./lib/coderay/encoders/text.rb
coderay-0.8.303 ./lib/coderay/encoders/text.rb
coderay-0.8.260 ./lib/coderay/encoders/text.rb
coderay-0.8.273 ./lib/coderay/encoders/text.rb
coderay-0.8.312 ./lib/coderay/encoders/text.rb
typo-5.1.98 vendor/gems/coderay-0.8.260/lib/coderay/encoders/text.rb
typo-5.2 vendor/gems/coderay-0.8.260/lib/coderay/encoders/text.rb
typo-5.2.98 vendor/gems/coderay-0.8.260/lib/coderay/encoders/text.rb
typo-5.3 vendor/gems/coderay-0.8.260/lib/coderay/encoders/text.rb