diff options
Diffstat (limited to 'lib/timeout.rb')
-rw-r--r-- | lib/timeout.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/timeout.rb b/lib/timeout.rb index bf12f37382..c8c3d501b6 100644 --- a/lib/timeout.rb +++ b/lib/timeout.rb @@ -164,6 +164,7 @@ module Timeout # Timeout</tt> into your classes so they have a #timeout method, as well as # a module method, so you can call it directly as Timeout.timeout(). def timeout(sec, klass = nil, message = nil, &block) #:yield: +sec+ + raise ArgumentError, "Timeout sec must be a positive number" unless sec.is_a?(Numeric) && sec >= 0 return yield(sec) if sec == nil or sec.zero? message ||= "execution expired" |