Ensures the root of chain
has a trusted certificate in trust_dir
and the digests of the two certificates match according to digester
Return the 2 dependency objects that conflicted
Returns true
if this gem is installable for the current platform.
Returns true
if this gem is installable for the current platform.
Returns true if this specification is installable on this platform.
Add a certificate to trusted certificate list.
Factory for servlet instances that will handle a request from server
using options
from the mount point. By default a new servlet instance is created for every call.
Every method call is forwarded to the XML-RPC server defined in XMLRPC::Client::Proxy#new.
Note: Inherited methods from class Object
cannot be used as XML-RPC names, because they get around method_missing
.
Creates a string representation of self
.
[ "a", "b", "c" ].to_s #=> "[\"a\", \"b\", \"c\"]"
Returns the first element, or the first n
elements, of the array. If the array is empty, the first form returns nil
, and the second form returns an empty array. See also Array#last
for the opposite effect.
a = [ "q", "r", "s", "t" ] a.first #=> "q" a.first(2) #=> ["q", "r"]
Returns the last element(s) of self
. If the array is empty, the first form returns nil
.
See also Array#first
for the opposite effect.
a = [ "w", "x", "y", "z" ] a.last #=> "z" a.last(2) #=> ["y", "z"]
Inserts the given values before the element with the given index
.
Negative indices count backwards from the end of the array, where -1
is the last element. If a negative index is used, the given values will be inserted after that element, so using an index of -1
will insert the values at the end of the array.
a = %w{ a b c d } a.insert(2, 99) #=> ["a", "b", 99, "c", "d"] a.insert(-2, 1, 2, 3) #=> ["a", "b", 99, "c", 1, 2, 3, "d"]
Returns the number of elements in self
. May be zero.
[ 1, 2, 3, 4, 5 ].length #=> 5 [].length #=> 0
Returns the index of the first object in ary
such that the object is ==
to obj
.
If a block is given instead of an argument, returns the index of the first object for which the block returns true
. Returns nil
if no match is found.
See also Array#rindex
.
An Enumerator
is returned if neither a block nor argument is given.
a = [ "a", "b", "c" ] a.index("b") #=> 1 a.index("z") #=> nil a.index { |x| x == "b" } #=> 1
Returns a string created by converting each element of the array to a string, separated by the given separator
. If the separator
is nil
, it uses current $,. If both the separator
and $, are nil, it uses empty string.
[ "a", "b", "c" ].join #=> "abc" [ "a", "b", "c" ].join("-") #=> "a-b-c"
Assumes that self
is an array of arrays and transposes the rows and columns.
a = [[1,2], [3,4], [5,6]] a.transpose #=> [[1, 3, 5], [2, 4, 6]]
If the length of the subarrays don’t match, an IndexError
is raised.
Returns true
if the given object
is present in self
(that is, if any element ==
object
), otherwise returns false
.
a = [ "a", "b", "c" ] a.include?("b") #=> true a.include?("z") #=> false
When invoked with a block, yields all combinations of length n
of elements from the array and then returns the array itself.
The implementation makes no guarantees about the order in which the combinations are yielded.
If no block is given, an Enumerator
is returned instead.
Examples:
a = [1, 2, 3, 4] a.combination(1).to_a #=> [[1],[2],[3],[4]] a.combination(2).to_a #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]] a.combination(3).to_a #=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]] a.combination(4).to_a #=> [[1,2,3,4]] a.combination(0).to_a #=> [[]] # one combination of length 0 a.combination(5).to_a #=> [] # no combinations of length 5
Builds a command line string from an argument list array
joining all elements escaped for the Bourne shell and separated by a space.
See Shellwords.shelljoin
for details.
Returns the remainder after dividing big by numeric.
-1234567890987654321.remainder(13731) #=> -6966 -1234567890987654321.remainder(13731.24) #=> -9906.22531493148
Returns a string containing the representation of big radix base (2 through 36).
12345654321.to_s #=> "12345654321" 12345654321.to_s(2) #=> "1011011111110110111011110000110001" 12345654321.to_s(8) #=> "133766736061" 12345654321.to_s(16) #=> "2dfdbbc31" 78546939656932.to_s(36) #=> "rubyrules"
Returns a complex object which denotes the given rectangular form.
Complex.rectangular(1, 2) #=> (1+2i)
Returns the imaginary part.
Complex(7).imaginary #=> 0 Complex(9, -4).imaginary #=> -4