Prints the amount of time the supplied block takes to run using the debug UI output.
Raises a TypeError
to prevent cloning.
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.
Note that this is both a method of module Timeout
, so you can include Timeout
into your classes so they have a timeout
method, as well as a module method, so you can call it directly as Timeout.timeout()
.
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.
Note that this is both a method of module Timeout
, so you can include Timeout
into your classes so they have a timeout
method, as well as a module method, so you can call it directly as Timeout.timeout()
.
Gets the scheduling priority for specified process, process group, or user. kind indicates the kind of entity to find: one of Process::PRIO_PGRP
, Process::PRIO_USER
, or Process::PRIO_PROCESS
. integer is an id indicating the particular process, process group, or user (an id of 0 means current). Lower priorities are more favorable for scheduling. Not available on all platforms.
Process.getpriority(Process::PRIO_USER, 0) #=> 19 Process.getpriority(Process::PRIO_PROCESS, 0) #=> 19
See Process#getpriority
.
Process.setpriority(Process::PRIO_USER, 0, 19) #=> 0 Process.setpriority(Process::PRIO_PROCESS, 0, 19) #=> 0 Process.getpriority(Process::PRIO_USER, 0) #=> 19 Process.getpriority(Process::PRIO_PROCESS, 0) #=> 19
Returns a Tms
structure (see Process::Tms
) that contains user and system CPU times for this process, and also for children processes.
t = Process.times [ t.utime, t.stime, t.cutime, t.cstime ] #=> [0.0, 0.02, 0.00, 0.00]
Returns the form how EC::Point
data is encoded as ASN.1.
See also point_conversion_form=
.
Sets the form how EC::Point
data is encoded as ASN.1 as defined in X9.62.
format
can be one of these:
Encoded as z||x, where z is an octet indicating which solution of the equation y is. z will be 0x02 or 0x03.
Encoded as z||x||y, where z is an octet 0x04.
Encodes as z||x||y, where z is an octet indicating which solution of the equation y is. z will be 0x06 or 0x07.
See the OpenSSL
documentation for EC_GROUP_set_point_conversion_form()
Add file name
with permissions mode
size
bytes long. Yields an IO
to write the file to.
Return the best specification that contains the file matching path
amongst the specs that are not activated.
Enumerates the outdated local gems yielding the local specification and the latest remote version.
This method may take some time to return as it must check each local gem against the server’s index.
Sets up the resolution process @return [void]
Ends the resolution process @return [void]
Creates a digest object and reads a given file, name. Optional arguments are passed to the constructor of the digest class.
p Digest::SHA256.file("X11R6.8.2-src.tar.bz2").hexdigest # => "f02e3c85572dc9ad7cb77c2a638e3be24cc1b5bea9fdbb0b0299c9668475c534"
Array of the currently loaded libraries.
Returns true
if this is a null pointer.
It is only necessary to run cleanup when engines are loaded via OpenSSL::Engine.load
. However, running cleanup before exit is recommended.
Note that this is needed and works only in OpenSSL
< 1.1.0.