Sha256: c9b457e9680f6b93351113e809a5ee867a46261aa38e94756d9f953d9fb456fc

Contents?: true

Size: 402 Bytes

Versions: 3

Compression:

Stored size: 402 Bytes

Contents

module WebConsole::REPL
  class OutputController < WebConsole::Controller

    attr_accessor :view
    def initialize(view)
      @view = view
    end

    def parse_output(output)
      output = output.dup
      output.gsub!(/\x1b[^m]*m/, "") # Remove escape sequences
      output.chomp!
      if !output.strip.empty? # Ignore empty lines
        @view.add_output(output)
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webconsole-0.2.1 lib/webconsole/repl/lib/output_controller.rb
webconsole-0.2.0 lib/webconsole/repl/lib/output_controller.rb
webconsole-0.1.19 lib/webconsole/repl/lib/output_controller.rb