lib/octospy/extensions/string.rb in octospy-0.0.6 vs lib/octospy/extensions/string.rb in octospy-0.0.7
- old
+ new
@@ -1,7 +1,7 @@
require 'string-irc'
-require 'octospy/shortener'
+require 'octospy/url'
module Octospy
module Extensions
module String
def underscore
@@ -20,17 +20,10 @@
def colorize_for_irc
StringIrc.new(self)
end
def shorten_url
- case
- when self =~ /https?:\/\/(\w+\.)?github\.com/
- Octospy::Shortener.shorten_by_github self
- when self =~ /https?:\/\/.+/
- Octospy::Shortener.shorten_by_google self
- else
- self
- end
+ Octospy::Url.shorten self
end
alias_method :shorten, :shorten_url
end
end
end