Class: Debugger::LocalInterface
- Defined in:
- lib/ruby-debug/interface.rb
Overview
:nodoc:
Constant Summary collapse
- FILE_HISTORY =
".rdebug_hist"
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
Things to do before quitting.
-
#initialize ⇒ LocalInterface
constructor
A new instance of LocalInterface.
- #print(*args) ⇒ Object
- #read_command(prompt) ⇒ Object
- #readline_support? ⇒ Boolean
Methods inherited from Interface
#afmt, #aprint, #errmsg, #print_debug
Constructor Details
#initialize ⇒ LocalInterface
Returns a new instance of LocalInterface.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/ruby-debug/interface.rb', line 55 def initialize() super @command_queue = [] @have_readline = false @history_save = true # take gdb's default @history_length = ENV["HISTSIZE"] ? ENV["HISTSIZE"].to_i : 256 @histfile = File.join(ENV["HOME"]||ENV["HOMEPATH"]||".", FILE_HISTORY) open(@histfile, 'r') do |file| file.each do |line| line.chomp! Readline::HISTORY << line end end if File.exist?(@histfile) @restart_file = nil end |
Instance Attribute Details
#command_queue ⇒ Object
Returns the value of attribute command_queue.
46 47 48 |
# File 'lib/ruby-debug/interface.rb', line 46 def command_queue @command_queue end |
#histfile ⇒ Object
Returns the value of attribute histfile.
47 48 49 |
# File 'lib/ruby-debug/interface.rb', line 47 def histfile @histfile end |
#history_length ⇒ Object
Returns the value of attribute history_length.
49 50 51 |
# File 'lib/ruby-debug/interface.rb', line 49 def history_length @history_length end |
#history_save ⇒ Object
Returns the value of attribute history_save.
48 49 50 |
# File 'lib/ruby-debug/interface.rb', line 48 def history_save @history_save end |
#restart_file ⇒ Object
Returns the value of attribute restart_file.
50 51 52 |
# File 'lib/ruby-debug/interface.rb', line 50 def restart_file @restart_file end |
Instance Method Details
#close ⇒ Object
85 86 |
# File 'lib/ruby-debug/interface.rb', line 85 def close end |
#confirm(prompt) ⇒ Object
77 78 79 |
# File 'lib/ruby-debug/interface.rb', line 77 def confirm(prompt) readline(prompt, false) end |
#finalize ⇒ Object
Things to do before quitting
89 90 91 92 93 94 95 96 |
# File 'lib/ruby-debug/interface.rb', line 89 def finalize if Debugger.method_defined?("annotate") and Debugger.annotate.to_i > 2 print "\032\032exited\n\n" end if Debugger.respond_to?(:save_history) Debugger.save_history end end |
#print(*args) ⇒ Object
81 82 83 |
# File 'lib/ruby-debug/interface.rb', line 81 def print(*args) STDOUT.printf(*escape_input(args)) end |
#read_command(prompt) ⇒ Object
73 74 75 |
# File 'lib/ruby-debug/interface.rb', line 73 def read_command(prompt) readline(prompt, true) end |
#readline_support? ⇒ Boolean
98 99 100 |
# File 'lib/ruby-debug/interface.rb', line 98 def readline_support? @have_readline end |