Sets the nonce (number used once) that the server shall include in its response. If the nonce is set, the server must return the same nonce value in a valid Response.
Returns the nonce (number used once) that the server shall include in its response.
Connect to IO tcp, with context of the current certificate configuration
The version of this activation request’s specification
The version of the gem for this specification.
Like Enumerable#take_while, but chains operation to be lazy-evaluated.
Like Enumerable#drop_while, but chains operation to be lazy-evaluated.
Build a single index for RubyGems 1.2 and newer
Builds indices for RubyGems 1.2 and newer. Handles full, latest, prerelease
The location of the default spec file for default gems.
Returns the count of elements in self.
Removes zero or more elements from self; returns self.
When no block is given, removes from self each element ele such that ele == obj; returns the last deleted element:
s1 = 'bar'; s2 = 'bar' a = [:foo, s1, 2, s2] a.delete('bar') # => "bar" a # => [:foo, 2]
Returns nil if no elements removed.
When a block is given, removes from self each element ele such that ele == obj.
If any such elements are found, ignores the block and returns the last deleted element:
s1 = 'bar'; s2 = 'bar' a = [:foo, s1, 2, s2] deleted_obj = a.delete('bar') {|obj| fail 'Cannot happen' } a # => [:foo, 2]
If no such elements are found, returns the block’s return value:
a = [:foo, 'bar', 2] a.delete(:nosuch) {|obj| "#{obj} not found" } # => "nosuch not found"
When called with positive Integer argument count and a block, calls the block with each element, then does so again, until it has done so count times; returns nil:
output = [] [0, 1].cycle(2) {|element| output.push(element) } # => nil output # => [0, 1, 0, 1]
If count is zero or negative, does not call the block:
[0, 1].cycle(0) {|element| fail 'Cannot happen' } # => nil [0, 1].cycle(-1) {|element| fail 'Cannot happen' } # => nil
When a block is given, and argument is omitted or nil, cycles forever:
# Prints 0 and 1 forever. [0, 1].cycle {|element| puts element } [0, 1].cycle(nil) {|element| puts element }
When no block is given, returns a new Enumerator:
[0, 1].cycle(2) # => #<Enumerator: [0, 1]:cycle(2)> [0, 1].cycle # => # => #<Enumerator: [0, 1]:cycle> [0, 1].cycle.first(5) # => [0, 1, 0, 1, 0]
Shuffles the elements of self in place.
a = [1, 2, 3] #=> [1, 2, 3] a.shuffle! #=> [2, 3, 1] a #=> [2, 3, 1]
The optional random argument will be used as the random number generator:
a.shuffle!(random: Random.new(1)) #=> [1, 3, 2]