module Byebug::Helpers::StringHelper
def camelize(str)
ACamelizedString.
Converts +str+ from an_underscored-or-dasherized_string to
def camelize(str) str.dup.split(/[_-]/).map(&:capitalize).join("") end
def deindent(str, leading_spaces: 6)
Removes a number of leading whitespace for each input line.
def deindent(str, leading_spaces: 6) str.gsub(/^ {#{leading_spaces}}/, "") end
def prettify(str)
command prompt.
Improves indentation and spacing in +str+ for readability in Byebug's
def prettify(str) "\n" + deindent(str) + "\n" end