Skip to content

Commit

Permalink
Handle the url shortener being dead, v1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaberer committed May 19, 2014
1 parent 956a218 commit afc38ba
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
22 changes: 21 additions & 1 deletion .travis.yml
@@ -1,4 +1,24 @@
language: ruby
env:
global:
- "JRUBY_OPTS=-Xcext.enabled=true"
rvm:
- 1.9.2
- 2.1.0
- 2.0.0
- 1.9.3
- 1.9.2
- 1.8.7
- jruby-18mode
- jruby-19mode
- rbx
- ruby-head
- jruby-head
- ree
matrix:
allow_failures:
- rvm: 1.8.7
- rvm: ree
- rvm: jruby-18mode
- rvm: jruby-19mode
- rvm: jruby-head
fast_finish: true
3 changes: 3 additions & 0 deletions lib/cinch/toolbox.rb
Expand Up @@ -66,6 +66,9 @@ def self.shorten(url)
uri = URI.parse("http://is.gd/create.php?format=simple&url=#{url}")
shortened = Net::HTTP.get(uri)
shortened if shortened.match(%r(https?://is.gd/))
rescue Errno::ETIMEDOUT
# if the URL shortener is down, handle it.
url
end

# Expand a previously shortened URL via the configured shortener
Expand Down
2 changes: 1 addition & 1 deletion lib/cinch/toolbox/version.rb
Expand Up @@ -2,6 +2,6 @@
module Cinch
# Version Info
module Toolbox
VERSION = '1.1.2'
VERSION = '1.1.3'
end
end

0 comments on commit afc38ba

Please sign in to comment.