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]
Returns the current session cache size. Zero is used to represent an unlimited cache size.
Sets the session cache size. Returns the previously valid session cache size. Zero is used to represent an unlimited session cache size.
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
Oldest version we support downgrading to. This is the version that originally ships with the first patch version of each ruby, because we never test each ruby against older rubygems, so we can’t really guarantee it works. Version list can be checked here: stdgems.org/rubygems
The required_ruby_version
constraint for this specification
A fallback is included because when generated, some marshalled specs have it set to nil
.
The required_rubygems_version
constraint for this specification
A fallback is included because the original version of the specification API didn’t include that field, so some marshalled specs in the index have it set to nil
.
The required_ruby_version
constraint for this specification
The required_rubygems_version
constraint for this specification
Deletes an element from self
, per the given Integer index
.
When index
is non-negative, deletes the element at offset index
:
a = [:foo, 'bar', 2] a.delete_at(1) # => "bar" a # => [:foo, 2]
If index is too large, returns nil
.
When index
is negative, counts backward from the end of the array:
a = [:foo, 'bar', 2] a.delete_at(-2) # => "bar" a # => [:foo, 2]
If index
is too small (far from zero), returns nil.
Removes each element in self
for which the block returns a truthy value; returns self
:
a = [:foo, 'bar', 2, 'bat'] a.delete_if {|element| element.to_s.start_with?('b') } # => [:foo, 2]
Returns a new Enumerator if no block given:
a = [:foo, 'bar', 2] a.delete_if # => #<Enumerator: [:foo, "bar", 2]:delete_if>
Returns a new Array containing zero or more leading elements of self
; does not modify self
.
With a block given, calls the block with each successive element of self
; stops if the block returns false
or nil
; returns a new Array
containing those elements for which the block returned a truthy value:
a = [0, 1, 2, 3, 4, 5] a.take_while {|element| element < 3 } # => [0, 1, 2] a.take_while {|element| true } # => [0, 1, 2, 3, 4, 5] a # => [0, 1, 2, 3, 4, 5]
With no block given, returns a new Enumerator:
[0, 1].take_while # => #<Enumerator: [0, 1]:take_while>
Returns a new Array containing zero or more trailing elements of self
; does not modify self
.
With a block given, calls the block with each successive element of self
; stops if the block returns false
or nil
; returns a new Array
omitting those elements for which the block returned a truthy value:
a = [0, 1, 2, 3, 4, 5] a.drop_while {|element| element < 3 } # => [3, 4, 5]
With no block given, returns a new Enumerator:
[0, 1].drop_while # => # => #<Enumerator: [0, 1]:drop_while>
Returns the list of private methods accessible to obj. If the all parameter is set to false
, only those methods in the receiver will be listed.
Returns the list of public methods accessible to obj. If the all parameter is set to false
, only those methods in the receiver will be listed.
Similar to method, searches public method only.
Returns the number of bits of the value of int
.
“Number of bits” means the bit position of the highest bit which is different from the sign bit (where the least significant bit has bit position 1). If there is no such bit (zero or minus one), zero is returned.
I.e. this method returns ceil(log2(int < 0 ? -int : int+1)).
(-2**1000-1).bit_length #=> 1001 (-2**1000).bit_length #=> 1000 (-2**1000+1).bit_length #=> 1000 (-2**12-1).bit_length #=> 13 (-2**12).bit_length #=> 12 (-2**12+1).bit_length #=> 12 -0x101.bit_length #=> 9 -0x100.bit_length #=> 8 -0xff.bit_length #=> 8 -2.bit_length #=> 1 -1.bit_length #=> 0 0.bit_length #=> 0 1.bit_length #=> 1 0xff.bit_length #=> 8 0x100.bit_length #=> 9 (2**12-1).bit_length #=> 12 (2**12).bit_length #=> 13 (2**12+1).bit_length #=> 13 (2**1000-1).bit_length #=> 1000 (2**1000).bit_length #=> 1001 (2**1000+1).bit_length #=> 1001
This method can be used to detect overflow in Array#pack
as follows:
if n.bit_length < 32 [n].pack("l") # no overflow else raise "overflow" end