Sha256: 4b26b8a94f03786c30ee360a895d7c62ad8cd5159a0351d5e29f7c4a46361be7

Contents?: true

Size: 597 Bytes

Versions: 27

Compression:

Stored size: 597 Bytes

Contents

module Byebug
  #
  # Interface class for command execution from script files.
  #
  class ScriptInterface < Interface
    def initialize(file, verbose = false)
      super()
      @input = File.open(file)
      @output = verbose ? STDOUT : StringIO.new
      @error = verbose ? STDERR : StringIO.new
    end

    def read_command(prompt)
      readline(prompt, false)
    end

    def close
      input.close
    end

    def readline(*)
      while (result = input.gets)
        output.puts "+ #{result}"
        next if result =~ /^\s*#/
        return result.chomp
      end
    end
  end
end

Version data entries

27 entries across 26 versions & 3 rubygems

Version Path
byebug-9.0.3 lib/byebug/interfaces/script_interface.rb
byebug-9.0.2 lib/byebug/interfaces/script_interface.rb
byebug-9.0.1 lib/byebug/interfaces/script_interface.rb
byebug-9.0.0 lib/byebug/interfaces/script_interface.rb
byebug-8.2.5 lib/byebug/interfaces/script_interface.rb
byebug-8.2.4 lib/byebug/interfaces/script_interface.rb
byebug-8.2.3 lib/byebug/interfaces/script_interface.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/byebug-4.0.5/lib/byebug/interfaces/script_interface.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/byebug-4.0.5/lib/byebug/interfaces/script_interface.rb
byebug-8.2.2 lib/byebug/interfaces/script_interface.rb
byebug-8.2.1 lib/byebug/interfaces/script_interface.rb
byebug-8.2.0 lib/byebug/interfaces/script_interface.rb
byebug-8.1.0 lib/byebug/interfaces/script_interface.rb
byebug-8.0.1 lib/byebug/interfaces/script_interface.rb
byebug-8.0.0 lib/byebug/interfaces/script_interface.rb
byebug-7.0.0 lib/byebug/interfaces/script_interface.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/byebug-5.0.0/lib/byebug/interfaces/script_interface.rb
byebug-6.0.2 lib/byebug/interfaces/script_interface.rb
byebug-6.0.1 lib/byebug/interfaces/script_interface.rb
byebug-6.0.0 lib/byebug/interfaces/script_interface.rb