Class: Byebug::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/byebug/interface.rb

Direct Known Subclasses

LocalInterface, RemoteInterface, ScriptInterface

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInterface

Returns a new instance of Interface.



5
6
7
# File 'lib/byebug/interface.rb', line 5

def initialize
  @command_queue, @restart_file = [], nil
end

Instance Attribute Details

#command_queueObject

Returns the value of attribute command_queue.



3
4
5
# File 'lib/byebug/interface.rb', line 3

def command_queue
  @command_queue
end

#restart_fileObject

Returns the value of attribute restart_file.



3
4
5
# File 'lib/byebug/interface.rb', line 3

def restart_file
  @restart_file
end

Instance Method Details

#errmsg(*args) ⇒ Object

Common routine for reporting byebug error messages. Derived classes may want to override this to capture output.



11
12
13
14
# File 'lib/byebug/interface.rb', line 11

def errmsg(*args)
  print '*** '
  print(*args)
end

#escape(msg) ⇒ Object



26
27
28
# File 'lib/byebug/interface.rb', line 26

def escape(msg)
  msg.gsub('%', '%%')
end

#format(*args) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/byebug/interface.rb', line 16

def format(*args)
  if args.is_a?(Array)
    new_args = args.first
    new_args = new_args % args[1..-1] unless args[1..-1].empty?
  else
    new_args = args
  end
  new_args
end