Module: Byebug::StringFunctions

Included in:
Command, Setting
Defined in:
lib/byebug/helper.rb

Overview

Utilities for interaction with files

Instance Method Summary collapse

Instance Method Details

#camelize(str) ⇒ Object

Converts str from an_underscored-or-dasherized_string to ACamelizedString.



53
54
55
# File 'lib/byebug/helper.rb', line 53

def camelize(str)
  str.dup.split(/[_-]/).map(&:capitalize).join('')
end

#prettify(str) ⇒ Object

Improves indentation and spacing in str for readability in Byebug’s command prompt.



61
62
63
# File 'lib/byebug/helper.rb', line 61

def prettify(str)
  "\n" + str.gsub(/^ {8}/, '') + "\n"
end