lib/octospy/extensions/string.rb in octospy-0.0.8 vs lib/octospy/extensions/string.rb in octospy-0.1.0
- old
+ new
@@ -15,9 +15,13 @@
def split_by_linefeed_except_blankline
self.split(/\r\n|\n/).map { |v| v unless v.eql? '' }.compact
end
alias_method :split_lfbl, :split_by_linefeed_except_blankline
+ def compact
+ self.gsub(/\s+/, ' ').strip
+ end
+
def colorize_for_irc
StringIrc.new(self)
end
def shorten_url