class String

Public Instance Methods

blank?() click to toggle source
# File lib/gitx/extensions/string.rb, line 9
def blank?
  to_s == ''
end
dedent()
Alias for: undent
starts_with?(prefix) click to toggle source

@see apidock.com/rails/ActiveSupport/CoreExtensions/String/StartsEndsWith/starts_with%

# File lib/gitx/extensions/string.rb, line 14
def starts_with?(prefix)
  prefix.respond_to?(:to_str) && self[0, prefix.length] == prefix
end
undent() click to toggle source

@see api.rubyonrails.org/classes/String.html#method-i-strip_heredoc

# File lib/gitx/extensions/string.rb, line 3
def undent
  indent = scan(/^[ \t]*(?=\S)/).min.size || 0
  gsub(/^[ \t]{#{indent}}/, '')
end
Also aliased as: dedent