Skip to content

Commit b9ad8fa

Browse files
deivid-rodriguezhsbt
authored andcommitted
Bump vendored timeout to 0.4.3
1 parent 498d6eb commit b9ad8fa

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/rubygems/vendor/timeout/lib/timeout.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
module Gem::Timeout
2222
# The version
23-
VERSION = "0.4.2"
23+
VERSION = "0.4.3"
2424

2525
# Internal error raised to when a timeout is triggered.
2626
class ExitException < Exception
@@ -141,9 +141,10 @@ def self.ensure_timeout_thread_created
141141
# Perform an operation in a block, raising an error if it takes longer than
142142
# +sec+ seconds to complete.
143143
#
144-
# +sec+:: Number of seconds to wait for the block to terminate. Any number
145-
# may be used, including Floats to specify fractional seconds. A
144+
# +sec+:: Number of seconds to wait for the block to terminate. Any non-negative number
145+
# or nil may be used, including Floats to specify fractional seconds. A
146146
# value of 0 or +nil+ will execute the block without any timeout.
147+
# Any negative number will raise an ArgumentError.
147148
# +klass+:: Exception Class to raise if the block fails to terminate
148149
# in +sec+ seconds. Omitting will use the default, Gem::Timeout::Error
149150
# +message+:: Error message to raise with Exception Class.
@@ -165,6 +166,7 @@ def self.ensure_timeout_thread_created
165166
# a module method, so you can call it directly as Gem::Timeout.timeout().
166167
def timeout(sec, klass = nil, message = nil, &block) #:yield: +sec+
167168
return yield(sec) if sec == nil or sec.zero?
169+
raise ArgumentError, "Timeout sec must be a non-negative number" if 0 > sec
168170

169171
message ||= "execution expired"
170172

tool/bundler/vendor_gems.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
gem "pub_grub", github: "jhawthorn/pub_grub"
1212
gem "resolv", "0.6.0"
1313
gem "securerandom", "0.4.0"
14-
gem "timeout", "0.4.2"
14+
gem "timeout", "0.4.3"
1515
gem "thor", "1.3.2"
1616
gem "tsort", "0.2.0"
1717
gem "uri", "1.0.2"

0 commit comments

Comments
 (0)