From 3e2b3ece4637b4c34b904b71db4bbadad7762616 Mon Sep 17 00:00:00 2001 From: Seth Falcon Date: Fri, 12 Jun 2009 14:06:07 -0700 Subject: [PATCH] Timeout::TimeoutError does not exist, use Timeout::Error instead Also added a require for 'timeout' that contains this code. Easy to get confused as there is an alias TimeoutError: irb(main):001:0> require 'timeout' => true irb(main):002:0> TimeoutError => Timeout::Error irb(main):003:0> Timeout::Error => Timeout::Error irb(main):004:0> Timeout::TimeoutError NameError: uninitialized constant Timeout::TimeoutError from (irb):4 --- lib/couchrest/monkeypatches.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/couchrest/monkeypatches.rb b/lib/couchrest/monkeypatches.rb index 2fad1f3..bebd49a 100644 --- a/lib/couchrest/monkeypatches.rb +++ b/lib/couchrest/monkeypatches.rb @@ -1,5 +1,6 @@ require File.join(File.dirname(__FILE__), 'support', 'class') require File.join(File.dirname(__FILE__), 'support', 'blank') +require 'timeout' # This file must be loaded after the JSON gem and any other library that beats up the Time class. class Time @@ -38,7 +39,7 @@ if RUBY_VERSION.to_f < 1.9 if IO.select([@io], nil, nil, @read_timeout) retry else - raise Timeout::TimeoutError + raise Timeout::Error end end else @@ -109,4 +110,4 @@ module RestClient # end # end -end \ No newline at end of file +end