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.
Returns a Hash
containing the following keys:
Number of started SSL/TLS handshakes in server mode
Number of established SSL/TLS sessions in server mode
Number of start renegotiations in server mode
Number of sessions that were removed due to cache overflow
Number of successfully reused connections
Number of sessions proposed by clients that were not found in the cache
Number of sessions in the internal session cache
Number of sessions retrieved from the external cache in server mode
Number of started SSL/TLS handshakes in client mode
Number of established SSL/TLS sessions in client mode
Number of start renegotiations in client mode
Number of sessions proposed by clients that were found in the cache but had expired due to timeouts
Enables use of shared session key material in accordance with RFC 5705.
Returns true
if key is the corresponding private key to the Subject Public Key Information, false
otherwise.
Like Enumerable#map
, but chains operation to be lazy-evaluated.
(1..Float::INFINITY).lazy.map {|i| i**2 } #=> #<Enumerator::Lazy: #<Enumerator::Lazy: 1..Infinity>:map> (1..Float::INFINITY).lazy.map {|i| i**2 }.first(3) #=> [1, 4, 9]
Like Enumerable#chunk
, but chains operation to be lazy-evaluated.
Iterates over the elements of the first enumerable by calling the “each” method on it with the given arguments, then proceeds to the following enumerables in sequence until all of the enumerables are exhausted.
If no block is given, returns an enumerator.
Iterates over the elements of the first enumerable by calling the “each_entry” method on it with the given arguments, then proceeds to the following enumerables in sequence until all of the enumerables are exhausted.
If no block is given, returns an enumerator. Otherwise, returns self.
Update the digest using given string and return self
.
Update the digest using a given string and return self.
Iterates for each entry in the /etc/passwd
file if a block is given.
If no block is given, returns the Enumerator
.
The code block is passed an Passwd
struct.
See Etc.getpwent
above for details.
Example:
require 'etc' Etc::Passwd.each {|u| puts u.name + " = " + u.gecos } Etc::Passwd.collect {|u| u.gecos} Etc::Passwd.collect {|u| u.gecos}
Iterates for each entry in the /etc/group
file if a block is given.
If no block is given, returns the Enumerator
.
The code block is passed a Group
struct.
Example:
require 'etc' Etc::Group.each {|g| puts g.name + ": " + g.mem.join(', ') } Etc::Group.collect {|g| g.name} Etc::Group.select {|g| !g.mem.empty?}
Create a new closure. If a block is given, the created closure is automatically freed after the given block is executed.
The all given arguments are passed to Fiddle::Closure.new
. So using this method without block equals to Fiddle::Closure.new
.
Fiddle::Closure.create(TYPE_INT, [TYPE_INT]) do |closure| # closure is freed automatically when this block is finished. end
Allocates a C struct with the types
provided.
See Fiddle::Pointer.malloc
for memory management issues.
# Automatically freeing the pointer when the block is exited - recommended Fiddle::Pointer.malloc(size, Fiddle::RUBY_FREE) do |pointer| ... end # Manually freeing but relying on the garbage collector otherwise pointer = Fiddle::Pointer.malloc(size, Fiddle::RUBY_FREE) ... pointer.call_free # Relying on the garbage collector - may lead to unlimited memory allocated before freeing any, but safe pointer = Fiddle::Pointer.malloc(size, Fiddle::RUBY_FREE) ... # Only manually freeing pointer = Fiddle::Pointer.malloc(size) begin ... ensure Fiddle.free pointer end # No free function and no call to free - the native memory will leak if the pointer is garbage collected pointer = Fiddle::Pointer.malloc(size) ...
Allocate size
bytes of memory and associate it with an optional freefunc
.
If a block is supplied, the pointer will be yielded to the block instead of being returned, and the return value of the block will be returned. A freefunc
must be supplied if a block is.
If a freefunc
is supplied it will be called once, when the pointer is garbage collected or when the block is left if a block is supplied or when the user calls call_free
, whichever happens first. freefunc
must be an address pointing to a function or an instance of Fiddle::Function
.