Sha256: 9778d5dddafb4d2252ef5ef5b04572dab4ff7edf54f02fa53e7a8b81e7c60e52

Contents?: true

Size: 737 Bytes

Versions: 6990

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,990 entries across 6,977 versions & 75 rubygems

Version Path
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
gameboard-3.1.0 vendor/bundle/ruby/2.3.0/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
gameboard-3.0.0 vendor/bundle/ruby/2.3.0/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
logstash-filter-base64-1.0.0 vendor/bundle/jruby/2.3.0/gems/coderay-1.1.1/lib/coderay/encoders/text.rb
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/coderay-1.1.0/lib/coderay/encoders/text.rb
coderay-1.1.1 lib/coderay/encoders/text.rb
coderay-1.1.1.rc1 lib/coderay/encoders/text.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/coderay-1.1.0/lib/coderay/encoders/text.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/text.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/coderay-1.1.0/lib/coderay/encoders/text.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/coderay-1.1.0/lib/coderay/encoders/text.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/coderay-1.1.0/lib/coderay/encoders/text.rb