Class Bcat::TextFilter
In: lib/bcat/reader.rb
Parent: Object

Methods

each   new  

Included Modules

Rack::Utils

Public Class methods

[Source]

    # File lib/bcat/reader.rb, line 87
87:     def initialize(source, force=false)
88:       @source = source
89:       @force = force
90:     end

Public Instance methods

[Source]

     # File lib/bcat/reader.rb, line 92
 92:     def each
 93:       yield "<pre>"
 94:       @source.each do |chunk|
 95:         chunk = escape_html(chunk)
 96:         chunk = "<span>#{chunk}</span>" if !chunk.gsub!(/\n/, "<br>")
 97:         yield chunk
 98:       end
 99:       yield "</pre>"
100:     end

[Validate]