/
opt
/
cpanel
/
ea-ruby27
/
root
/
usr
/
share
/
ruby
/
ruby-2.7.8
/
/opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.8
mkdir
upload
Name
Size
Mode
Actions
benchmark/
-
0755
rm
bigdecimal/
-
0755
rm
bundler/
-
0755
rm
cgi/
-
0755
rm
csv/
-
0755
rm
delegate/
-
0755
rm
did_you_mean/
-
0755
rm
digest/
-
0755
rm
drb/
-
0755
rm
fiddle/
-
0755
rm
forwardable/
-
0755
rm
getoptlong/
-
0755
rm
io/
-
0755
rm
irb/
-
0755
rm
json/
-
0755
rm
logger/
-
0755
rm
matrix/
-
0755
rm
net/
-
0755
rm
observer/
-
0755
rm
open3/
-
0755
rm
openssl/
-
0755
rm
optparse/
-
0755
rm
ostruct/
-
0755
rm
pstore/
-
0755
rm
psych/
-
0755
rm
racc/
-
0755
rm
rdoc/
-
0755
rm
reline/
-
0755
rm
rexml/
-
0755
rm
rinda/
-
0755
rm
ripper/
-
0755
rm
rss/
-
0755
rm
rubygems/
-
0755
rm
singleton/
-
0755
rm
syslog/
-
0755
rm
timeout/
-
0755
rm
tracer/
-
0755
rm
unicode_normalize/
-
0755
rm
uri/
-
0755
rm
webrick/
-
0755
rm
yaml/
-
0755
rm
abbrev.rb
3529
0644
edit
dl
rm
base64.rb
3379
0644
edit
dl
rm
benchmark.rb
18453
0644
edit
dl
rm
bigdecimal.rb
24
0644
edit
dl
rm
bundler.rb
23718
0644
edit
dl
rm
cgi.rb
10037
0644
edit
dl
rm
coverage.rb
368
0644
edit
dl
rm
csv.rb
55643
0644
edit
dl
rm
date.rb
1066
0644
edit
dl
rm
debug.rb
30624
0644
edit
dl
rm
delegate.rb
11343
0644
edit
dl
rm
did_you_mean.rb
3806
0644
edit
dl
rm
digest.rb
2894
0644
edit
dl
rm
drb.rb
50
0644
edit
dl
rm
English.rb
6258
0644
edit
dl
rm
erb.rb
29504
0644
edit
dl
rm
expect.rb
2217
0644
edit
dl
rm
fiddle.rb
1722
0644
edit
dl
rm
fileutils.rb
49271
0644
edit
dl
rm
find.rb
2526
0644
edit
dl
rm
forwardable.rb
9130
0644
edit
dl
rm
getoptlong.rb
15787
0644
edit
dl
rm
ipaddr.rb
19989
0644
edit
dl
rm
irb.rb
27603
0644
edit
dl
rm
json.rb
1809
0644
edit
dl
rm
kconv.rb
5861
0644
edit
dl
rm
logger.rb
16792
0644
edit
dl
rm
matrix.rb
61703
0644
edit
dl
rm
mkmf.rb
88539
0644
edit
dl
rm
monitor.rb
6920
0644
edit
dl
rm
mutex_m.rb
2214
0644
edit
dl
rm
observer.rb
5971
0644
edit
dl
rm
open-uri.rb
26088
0644
edit
dl
rm
open3.rb
22336
0644
edit
dl
rm
openssl.rb
469
0644
edit
dl
rm
optionparser.rb
59
0644
edit
dl
rm
optparse.rb
60919
0644
edit
dl
rm
ostruct.rb
10785
0644
edit
dl
rm
pathname.rb
16558
0644
edit
dl
rm
pp.rb
15978
0644
edit
dl
rm
prettyprint.rb
16276
0644
edit
dl
rm
prime.rb
12670
0644
edit
dl
rm
pstore.rb
15063
0644
edit
dl
rm
psych.rb
21718
0644
edit
dl
rm
racc.rb
137
0644
edit
dl
rm
rdoc.rb
5000
0644
edit
dl
rm
readline.rb
113
0644
edit
dl
rm
reline.rb
13253
0644
edit
dl
rm
resolv-replace.rb
1805
0644
edit
dl
rm
resolv.rb
75280
0644
edit
dl
rm
ripper.rb
2494
0644
edit
dl
rm
rss.rb
2963
0644
edit
dl
rm
rubygems.rb
39108
0644
edit
dl
rm
securerandom.rb
9528
0644
edit
dl
rm
set.rb
24622
0644
edit
dl
rm
shellwords.rb
6816
0644
edit
dl
rm
singleton.rb
4158
0644
edit
dl
rm
socket.rb
44702
0644
edit
dl
rm
tempfile.rb
11213
0644
edit
dl
rm
time.rb
24590
0644
edit
dl
rm
timeout.rb
4075
0644
edit
dl
rm
tmpdir.rb
4142
0644
edit
dl
rm
tracer.rb
6640
0644
edit
dl
rm
tsort.rb
14642
0644
edit
dl
rm
un.rb
10202
0644
edit
dl
rm
uri.rb
3039
0644
edit
dl
rm
weakref.rb
1473
0644
edit
dl
rm
webrick.rb
6890
0644
edit
dl
rm
yaml.rb
1845
0644
edit
dl
rm
Edit:
/opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.8/timeout.rb
(4075B)
# frozen_string_literal: false # Timeout long-running blocks # # == Synopsis # # require 'timeout' # status = Timeout::timeout(5) { # # Something that should be interrupted if it takes more than 5 seconds... # } # # == Description # # Timeout provides a way to auto-terminate a potentially long-running # operation if it hasn't finished in a fixed amount of time. # # Previous versions didn't use a module for namespacing, however # #timeout is provided for backwards compatibility. You # should prefer Timeout.timeout instead. # # == Copyright # # Copyright:: (C) 2000 Network Applied Communication Laboratory, Inc. # Copyright:: (C) 2000 Information-technology Promotion Agency, Japan module Timeout # Raised by Timeout.timeout when the block times out. class Error < RuntimeError attr_reader :thread def self.catch(*args) exc = new(*args) exc.instance_variable_set(:@thread, Thread.current) ::Kernel.catch(exc) {yield exc} end def exception(*) # TODO: use Fiber.current to see if self can be thrown if self.thread == Thread.current bt = caller begin throw(self, bt) rescue UncaughtThrowError end end self end end # :stopdoc: THIS_FILE = /\A#{Regexp.quote(__FILE__)}:/o CALLER_OFFSET = ((c = caller[0]) && THIS_FILE =~ c) ? 1 : 0 private_constant :THIS_FILE, :CALLER_OFFSET # :startdoc: # Perform an operation in a block, raising an error if it takes longer than # +sec+ seconds to complete. # # +sec+:: Number of seconds to wait for the block to terminate. Any number # may be used, including Floats to specify fractional seconds. A # value of 0 or +nil+ will execute the block without any timeout. # +klass+:: Exception Class to raise if the block fails to terminate # in +sec+ seconds. Omitting will use the default, Timeout::Error # +message+:: Error message to raise with Exception Class. # Omitting will use the default, "execution expired" # # Returns the result of the block *if* the block completed before # +sec+ seconds, otherwise throws an exception, based on the value of +klass+. # # The exception thrown to terminate the given block cannot be rescued inside # the block unless +klass+ is given explicitly. However, the block can use # ensure to prevent the handling of the exception. For that reason, this # method cannot be relied on to enforce timeouts for untrusted blocks. # # Note that this is both a method of module Timeout, so you can <tt>include # 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) #:yield: +sec+ return yield(sec) if sec == nil or sec.zero? message ||= "execution expired".freeze from = "from #{caller_locations(1, 1)[0]}" if $DEBUG e = Error bl = proc do |exception| begin x = Thread.current y = Thread.start { Thread.current.name = from begin sleep sec rescue => e x.raise e else x.raise exception, message end } return yield(sec) ensure if y y.kill y.join # make sure y is dead. end end end if klass begin bl.call(klass) rescue klass => e bt = e.backtrace end else bt = Error.catch(message, &bl) end level = -caller(CALLER_OFFSET).size-2 while THIS_FILE =~ bt[level] bt.delete_at(level) end raise(e, message, bt) end module_function :timeout end def timeout(*args, &block) warn "Object##{__method__} is deprecated, use Timeout.timeout instead.", uplevel: 1 Timeout.timeout(*args, &block) end # Another name for Timeout::Error, defined for backwards compatibility with # earlier versions of timeout.rb. TimeoutError = Timeout::Error class Object deprecate_constant :TimeoutError end
Save
cmd:
run