Module: Byebug::Helpers::StringHelper

Included in:
Command
Defined in:
lib/byebug/helpers/string.rb

Overview

Utilities for interaction with strings

Instance Method Summary collapse

Instance Method Details

#camelize(str) ⇒ Object

Converts str from an_underscored-or-dasherized_string to ACamelizedString.



11
12
13
# File 'lib/byebug/helpers/string.rb', line 11

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.



19
20
21
# File 'lib/byebug/helpers/string.rb', line 19

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