Sha256: 9778d5dddafb4d2252ef5ef5b04572dab4ff7edf54f02fa53e7a8b81e7c60e52

Contents?: true

Size: 737 Bytes

Versions: 6944

Compression:

Stored size: 737 Bytes

Contents

module CodeRay
module Encoders
  
  # Concats the tokens into a single string, resulting in the original
  # code string if no tokens were removed.
  # 
  # Alias: +plain+, +plaintext+
  # 
  # == Options
  # 
  # === :separator
  # A separator string to join the tokens.
  # 
  # Default: empty String
  class Text < Encoder
    
    register_for :text
    
    FILE_EXTENSION = 'txt'
    
    DEFAULT_OPTIONS = {
      :separator => nil
    }
    
    def text_token text, kind
      super
      
      if @first
        @first = false
      else
        @out << @sep
      end if @sep
    end
    
  protected
    def setup options
      super
      
      @first = true
      @sep = options[:separator]
    end
    
  end
  
end
end

Version data entries

6,944 entries across 6,932 versions & 73 rubygems

Version Path
cybrid_api_bank_ruby-0.123.132 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_id_ruby-0.123.132 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_organization_ruby-0.123.132 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_bank_ruby-0.123.131 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_id_ruby-0.123.131 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_organization_ruby-0.123.131 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_bank_ruby-0.123.129 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_id_ruby-0.123.129 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_organization_ruby-0.123.129 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_bank_ruby-0.123.127 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_id_ruby-0.123.127 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_organization_ruby-0.123.127 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_bank_ruby-0.123.126 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_id_ruby-0.123.126 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_organization_ruby-0.123.126 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
avalara_sdk-24.12.1 vendor/bundle/ruby/2.7.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_bank_ruby-0.123.125 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_organization_ruby-0.123.125 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_id_ruby-0.123.125 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb
cybrid_api_bank_ruby-0.123.124 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/text.rb