Returns a Digest
subclass by name
require 'openssl' OpenSSL::Digest("MD5") # => OpenSSL::Digest::MD5 Digest("Foo") # => NameError: wrong constant name Foo
Returns a Digest
subclass by name
require 'openssl' OpenSSL::Digest("MD5") # => OpenSSL::Digest::MD5 Digest("Foo") # => NameError: wrong constant name Foo
Return true
if the named file exists.
file_name can be an IO
object.
“file exists” means that stat() or fstat() system call is successful.
Returns true
if the named file has the sticky bit set.
file_name can be an IO
object.
Initiates garbage collection, even if manually disabled.
The full_mark
keyword argument determines whether or not to perform a major garbage collection cycle. When set to true
, a major garbage collection cycle is run, meaning all objects are marked. When set to false
, a minor garbage collection cycle is run, meaning only young objects are marked.
The immediate_mark
keyword argument determines whether or not to perform incremental marking. When set to true
, marking is completed during the call to this method. When set to false
, marking is performed in steps that are interleaved with future Ruby
code execution, so marking might not be completed during this method call. Note that if full_mark
is false
, then marking will always be immediate, regardless of the value of immediate_mark
.
The immediate_sweep
keyword argument determines whether or not to defer sweeping (using lazy sweep). When set to false
, sweeping is performed in steps that are interleaved with future Ruby
code execution, so sweeping might not be completed during this method call. When set to true
, sweeping is completed during the call to this method.
Note: These keyword arguments are implementation and version-dependent. They are not guaranteed to be future-compatible and may be ignored if the underlying implementation does not support them.
Returns the number of times GC has occurred since the process started.
Returns a Hash
containing information about the GC.
The contents of the hash are implementation-specific and may change in the future without notice.
The hash includes internal statistics about GC such as:
The total number of garbage collections run since application start (count includes both minor and major garbage collections)
The total time spent in garbage collections (in milliseconds)
The total number of :heap_eden_pages
+ :heap_tomb_pages
The number of pages that can fit into the buffer that holds references to all pages
The total number of pages the application could allocate without additional GC
The total number of slots in all :heap_allocated_pages
The total number of slots which contain live objects
The total number of slots which do not contain live objects
The total number of slots with pending finalizers to be run
The total number of objects marked in the last GC
The total number of pages which contain at least one live slot
The total number of pages which do not contain any live slots
The cumulative number of pages allocated since application start
The cumulative number of pages freed since application start
The cumulative number of objects allocated since application start
The cumulative number of objects freed since application start
Amount of memory allocated on the heap for objects. Decreased by any GC
When :malloc_increase_bytes
crosses this limit, GC is triggered
The total number of minor garbage collections run since process start
The total number of major garbage collections run since process start
The total number of compactions run since process start
The total number of times the read barrier was triggered during compaction
The total number of objects compaction has moved
The total number of objects without write barriers
When :remembered_wb_unprotected_objects
crosses this limit, major GC is triggered
Number of live, old objects which have survived at least 3 garbage collections
When :old_objects
crosses this limit, major GC is triggered
Amount of memory allocated on the heap for objects. Decreased by major GC
When :oldmalloc_increase_bytes
crosses this limit, major GC is triggered
If the optional argument, hash, is given, it is overwritten and returned. This is intended to avoid the probe effect.
This method is only expected to work on CRuby.
Get the default RubyGems API host. This is normally https://rubygems.org
.
Set
the default RubyGems API host.
Returns an array of the string names of FileUtils methods that accept one or more keyword arguments:
FileUtils.commands.sort.take(3) # => ["cd", "chdir", "chmod"]
Create a new scope with the given locals and forwarding options that is suitable for passing into one of the Prism.* methods that accepts the ‘scopes` option.
Returns the cosine of x
in radians.
Domain: (-INFINITY, INFINITY)
.
Range: [-1.0, 1.0]
.
Examples:
cos(-PI) # => -1.0 cos(-PI/2) # => 6.123031769111886e-17 # 0.0000000000000001 cos(0.0) # => 1.0 cos(PI/2) # => 6.123031769111886e-17 # 0.0000000000000001 cos(PI) # => -1.0
Returns the arc cosine of x
.
Domain: [-1, 1]
.
Range: [0, PI]
.
Examples:
acos(-1.0) # => 3.141592653589793 # PI acos(0.0) # => 1.5707963267948966 # PI/2 acos(1.0) # => 0.0
Returns the hyperbolic cosine of x
in radians.
Domain: [-INFINITY, INFINITY]
.
Range: [1, INFINITY]
.
Examples:
cosh(-INFINITY) # => Infinity cosh(0.0) # => 1.0 cosh(INFINITY) # => Infinity
Returns the inverse hyperbolic cosine of x
.
Domain: [1, INFINITY]
.
Range: [0, INFINITY]
.
Examples:
acosh(1.0) # => 0.0 acosh(INFINITY) # => Infinity
Returns a list of signal names mapped to the corresponding underlying signal numbers.
Signal.list #=> {"EXIT"=>0, "HUP"=>1, "INT"=>2, "QUIT"=>3, "ILL"=>4, "TRAP"=>5, "IOT"=>6, "ABRT"=>6, "FPE"=>8, "KILL"=>9, "BUS"=>7, "SEGV"=>11, "SYS"=>31, "PIPE"=>13, "ALRM"=>14, "TERM"=>15, "URG"=>23, "STOP"=>19, "TSTP"=>20, "CONT"=>18, "CHLD"=>17, "CLD"=>17, "TTIN"=>21, "TTOU"=>22, "IO"=>29, "XCPU"=>24, "XFSZ"=>25, "VTALRM"=>26, "PROF"=>27, "WINCH"=>28, "USR1"=>10, "USR2"=>12, "PWR"=>30, "POLL"=>29}
The offset from the start of the file in code units of the given encoding.
The column number in code units of the given encoding where this location ends from the start of the line.
in foo | bar