class String

Public Instance Methods

blank?() click to toggle source
# File lib/ditzstr/lowline.rb, line 12
def blank?; self =~ /\A\s*\z/ end
dcfirst() click to toggle source
# File lib/ditzstr/lowline.rb, line 11
def dcfirst; self[0..0].downcase + self[1..-1] end
multistrip() click to toggle source
# File lib/ditzstr/lowline.rb, line 19
def multistrip; strip.gsub(/\n\n+/, "\n\n") end
pluralize(n, b=true) click to toggle source
# File lib/ditzstr/lowline.rb, line 14
def pluralize n, b=true
  s = (n == 1 ? self : (self == 'bugfix' ? 'bugfixes' : self + "s")) # oh yeah
  b ? n.to_pretty_s + " " + s : s
end
shortened_email() click to toggle source
# File lib/ditzstr/lowline.rb, line 18
def shortened_email; self =~ /<?(\S+?)@.+/ ? $1 : self end
underline() click to toggle source
# File lib/ditzstr/lowline.rb, line 13
def underline; self + "\n" + ("-" * self.length) end