Class: Debugger::ScriptInterface
- Defined in:
- lib/ruby-debug/interface.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#command_queue ⇒ Object
Returns the value of attribute command_queue.
-
#histfile ⇒ Object
Returns the value of attribute histfile.
-
#history_length ⇒ Object
Returns the value of attribute history_length.
-
#history_save ⇒ Object
Returns the value of attribute history_save.
-
#restart_file ⇒ Object
Returns the value of attribute restart_file.
Attributes inherited from Interface
Instance Method Summary collapse
- #close ⇒ Object
- #confirm(prompt) ⇒ Object
- #finalize ⇒ Object
-
#initialize(file, out, verbose = false) ⇒ ScriptInterface
constructor
A new instance of ScriptInterface.
- #print(*args) ⇒ Object
- #read_command(prompt) ⇒ Object
- #readline_support? ⇒ Boolean
Methods inherited from Interface
Constructor Details
#initialize(file, out, verbose = false) ⇒ ScriptInterface
Returns a new instance of ScriptInterface.
191 192 193 194 195 196 197 198 199 200 |
# File 'lib/ruby-debug/interface.rb', line 191 def initialize(file, out, verbose=false) super() @command_queue = [] @file = file.respond_to?(:gets) ? file : open(file) @out = out @verbose = verbose @history_save = false @history_length = 256 # take gdb default @histfile = '' end |
Instance Attribute Details
#command_queue ⇒ Object
Returns the value of attribute command_queue.
186 187 188 |
# File 'lib/ruby-debug/interface.rb', line 186 def command_queue @command_queue end |
#histfile ⇒ Object
Returns the value of attribute histfile.
187 188 189 |
# File 'lib/ruby-debug/interface.rb', line 187 def histfile @histfile end |
#history_length ⇒ Object
Returns the value of attribute history_length.
189 190 191 |
# File 'lib/ruby-debug/interface.rb', line 189 def history_length @history_length end |
#history_save ⇒ Object
Returns the value of attribute history_save.
188 189 190 |
# File 'lib/ruby-debug/interface.rb', line 188 def history_save @history_save end |
#restart_file ⇒ Object
Returns the value of attribute restart_file.
190 191 192 |
# File 'lib/ruby-debug/interface.rb', line 190 def restart_file @restart_file end |
Instance Method Details
#close ⇒ Object
228 229 230 |
# File 'lib/ruby-debug/interface.rb', line 228 def close @file.close end |
#confirm(prompt) ⇒ Object
220 221 222 |
# File 'lib/ruby-debug/interface.rb', line 220 def confirm(prompt) 'y' end |
#finalize ⇒ Object
202 203 |
# File 'lib/ruby-debug/interface.rb', line 202 def finalize end |
#print(*args) ⇒ Object
224 225 226 |
# File 'lib/ruby-debug/interface.rb', line 224 def print(*args) @out.printf(*args) end |
#read_command(prompt) ⇒ Object
205 206 207 208 209 210 211 212 213 214 |
# File 'lib/ruby-debug/interface.rb', line 205 def read_command(prompt) while result = @file.gets puts "# #{result}" if @verbose next if result =~ /^\s*#/ next if result.strip.empty? break end raise IOError unless result result.chomp! end |
#readline_support? ⇒ Boolean
216 217 218 |
# File 'lib/ruby-debug/interface.rb', line 216 def readline_support? false end |