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.



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

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.



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

def have_readline=(value)
  @have_readline = value
end

Instance Method Details

#afmt(msg, newline = "\n") ⇒ Object

Format msg with gdb-style annotation header



24
25
26
# File 'lib/byebug/interface.rb', line 24

def afmt(msg, newline="\n")
  "\032\032#{msg}#{newline}"
end

#aprint(msg) ⇒ Object



28
29
30
# File 'lib/byebug/interface.rb', line 28

def aprint(msg)
  print afmt(msg)
end

#errmsg(*args) ⇒ Object

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



12
13
14
15
16
17
18
19
20
21
# File 'lib/byebug/interface.rb', line 12

def errmsg(*args)
  if Byebug.annotate.to_i > 2
    aprint 'error-begin'
    print(*args)
    aprint ''
  else
    print '*** '
    print(*args)
  end
end