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
  @have_readline = false
end

Instance Attribute Details

#have_readline=(value) ⇒ Object (writeonly)

Sets the attribute have_readline

Parameters:

  • value

    the value to set the attribute have_readline to.



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

def have_readline=(value)
  @have_readline = value
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