class String
Extensions to the core String class
def blank?
-
(Boolean)
- true is the string is blank, false otherwise
def blank? empty? || strip.empty? end
def strip_indent
- Todo: - Replace call sites with squiggly heredocs when required Ruby
def strip_indent leading_space = scan(/^[ \t]*(?=\S)/).min indent = leading_space ? leading_space.size : 0 gsub(/^[ \t]{#{indent}}/, '') end