Sha256: 8c745b4b99ba84f604d1234e452bfd0926f1f64b71cfeafa13af41eef5547435

Contents?: true

Size: 438 Bytes

Versions: 26

Compression:

Stored size: 438 Bytes

Contents

module Repla
  module REPL
    # Output controller
    class OutputController < Repla::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!
        @view.add_output(output) unless output.strip.empty? # Ignore empty lines
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
repla-0.10.4 lib/repla/repl/lib/output_controller.rb
repla-0.10.3 lib/repla/repl/lib/output_controller.rb
repla-0.10.2 lib/repla/repl/lib/output_controller.rb
repla-0.10.1 lib/repla/repl/lib/output_controller.rb
repla-0.10.0 lib/repla/repl/lib/output_controller.rb
repla-0.9.2 lib/repla/repl/lib/output_controller.rb
repla-0.9.1 lib/repla/repl/lib/output_controller.rb
repla-0.8.4 lib/repla/repl/lib/output_controller.rb
repla-0.8.3 lib/repla/repl/lib/output_controller.rb
repla-0.8.2 lib/repla/repl/lib/output_controller.rb
repla-0.8.1 lib/repla/repl/lib/output_controller.rb
repla-0.8.0 lib/repla/repl/lib/output_controller.rb
repla-0.7.6 lib/repla/repl/lib/output_controller.rb
repla-0.7.5 lib/repla/repl/lib/output_controller.rb
repla-0.7.4 lib/repla/repl/lib/output_controller.rb
repla-0.7.3 lib/repla/repl/lib/output_controller.rb
repla-0.7.2 lib/repla/repl/lib/output_controller.rb
repla-0.7.1 lib/repla/repl/lib/output_controller.rb
repla-0.7.0 lib/repla/repl/lib/output_controller.rb
repla-0.6.2 lib/repla/repl/lib/output_controller.rb