Class: Byebug::Interface
- Inherits:
-
Object
- Object
- Byebug::Interface
- Defined in:
- lib/byebug/interface.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#have_readline ⇒ Object
writeonly
Sets the attribute have_readline.
Instance Method Summary collapse
-
#afmt(msg, newline = "\n") ⇒ Object
Format msg with gdb-style annotation header.
- #aprint(msg) ⇒ Object
-
#errmsg(*args) ⇒ Object
Common routine for reporting byebug error messages.
-
#initialize ⇒ Interface
constructor
A new instance of Interface.
Constructor Details
#initialize ⇒ Interface
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
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 |