class Byebug::ScriptInterface


Interface class for command execution from script files.

def close

def close
  @file.close
end

def confirm(_prompt)

def confirm(_prompt)
  'y'
end

def initialize(file, out, verbose = false)

def initialize(file, out, verbose = false)
  super()
  @file = file.respond_to?(:gets) ? file : open(file)
  @out, @verbose = out, verbose
end

def puts(message)

def puts(message)
  @out.printf(message)
end

def read_command(_prompt)

def read_command(_prompt)
  while (result = @file.gets)
    puts "# #{result}" if @verbose
    next if result =~ /^\s*#/
    next if result.strip.empty?
    return result.chomp
  end
end