class Byebug::Printers::Plain
Plain text printer
Public Instance Methods
print(path, args = {})
click to toggle source
# File lib/byebug/printers/plain.rb, line 10 def print(path, args = {}) message = translate(locate(path), args) tail = parts(path).include?("confirmations") ? " (y/n) " : "\n" message << tail end
print_collection(path, collection, &block)
click to toggle source
# File lib/byebug/printers/plain.rb, line 16 def print_collection(path, collection, &block) lines = array_of_args(collection, &block).map do |args| print(path, args) end lines.join end
print_variables(variables, *_unused)
click to toggle source
# File lib/byebug/printers/plain.rb, line 24 def print_variables(variables, *_unused) print_collection("variable.variable", variables) do |(key, value), _| value = value.nil? ? "nil" : value.to_s if "#{key} = #{value}".size > Setting[:width] key_size = "#{key} = ".size value = value[0..Setting[:width] - key_size - 4] + "..." end { key: key, value: value } end end
Private Instance Methods
contents_files()
click to toggle source
Calls superclass method
Byebug::Printers::Base#contents_files
# File lib/byebug/printers/plain.rb, line 38 def contents_files [File.join(__dir__, "texts", "plain.yml")] + super end