Sha256: 8d5ba9645d80d51edc1aeaf0256f8feec0a9f686acd466c5a842ee0240378677
Contents?: true
Size: 611 Bytes
Versions: 9
Compression:
Stored size: 611 Bytes
Contents
module Byebug # # Interface class for command execution from script files. # class ScriptInterface < Interface def initialize(file, verbose = false) super() @verbose = verbose @input = File.open(file) @output = verbose ? $stdout : StringIO.new @error = $stderr end def read_command(prompt) readline(prompt, false) end def close input.close end def readline(*) while (result = input.gets) output.puts "+ #{result}" if @verbose next if result =~ /^\s*#/ return result.chomp end end end end
Version data entries
9 entries across 8 versions & 3 rubygems