Results for: "Dir.chdir"

SecureRandom.choose generates a string that randomly draws from a source array of characters.

The argument source specifies the array of characters from which to generate the string. The argument n specifies the length, in characters, of the string to be generated.

The result may contain whatever characters are in the source array.

require 'securerandom'

SecureRandom.choose([*'l'..'r'], 16) #=> "lmrqpoonmmlqlron"
SecureRandom.choose([*'0'..'9'], 5)  #=> "27309"

If a secure random number generator is not available, NotImplementedError is raised.

Switch the effective and real user IDs of the current process. If a block is given, the user IDs will be switched back after the block is executed. Returns the new effective user ID if called without a block, and the return value of the block if one is given.

Switch the effective and real group IDs of the current process. If a block is given, the group IDs will be switched back after the block is executed. Returns the new effective group ID if called without a block, and the return value of the block if one is given.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Called roughly every {#progress_rate}, this method should convey progress to the user.

@return [void]

@return [Array<Object>] all of the requirements that required

this vertex

(see Gem::Resolver::Molinillo::ResolutionState#requirements)

(see Gem::Resolver::Molinillo::ResolutionState#requirement)

Same as Array#each, but passes the index of the element instead of the element itself.

An Enumerator is returned if no block is given.

a = [ "a", "b", "c" ]
a.each_index {|x| print x, " -- " }

produces:

0 -- 1 -- 2 --

Same as Array#each, but traverses self in reverse order.

a = [ "a", "b", "c" ]
a.reverse_each {|x| print x, " " }

produces:

c b a

By using binary search, finds an index of a value from this array which meets the given condition in O(log n) where n is the size of the array.

It supports two modes, depending on the nature of the block. They are exactly the same as in the case of the bsearch method, with the only difference being that this method returns the index of the element instead of the element itself. For more details consult the documentation for bsearch.

Iterates the given block over all prime numbers.

See Prime#each for more details.

Splits str using the supplied parameter as the record separator ($/ by default), passing each substring in turn to the supplied block. If a zero-length record separator is supplied, the string is split into paragraphs delimited by multiple successive newlines.

See IO.readlines for details about getline_args.

If no block is given, an enumerator is returned instead.

print "Example one\n"
"hello\nworld".each_line {|s| p s}
print "Example two\n"
"hello\nworld".each_line('l') {|s| p s}
print "Example three\n"
"hello\n\n\nworld".each_line('') {|s| p s}

produces:

Example one
"hello\n"
"world"
Example two
"hel"
"l"
"o\nworl"
"d"
Example three
"hello\n\n"
"world"

Passes each byte in str to the given block, or returns an enumerator if no block is given.

"hello".each_byte {|c| print c, ' ' }

produces:

104 101 108 108 111

Passes the Integer ordinal of each character in str, also known as a codepoint when applied to Unicode strings to the given block. For encodings other than UTF-8/UTF-16(BE|LE)/UTF-32(BE|LE), values are directly derived from the binary representation of each character.

If no block is given, an enumerator is returned instead.

"hello\u0639".each_codepoint {|c| print c, ' ' }

produces:

104 101 108 108 111 1593

Returns the locale charmap name. It returns nil if no appropriate information.

Debian GNU/Linux
  LANG=C
    Encoding.locale_charmap  #=> "ANSI_X3.4-1968"
  LANG=ja_JP.EUC-JP
    Encoding.locale_charmap  #=> "EUC-JP"

SunOS 5
  LANG=C
    Encoding.locale_charmap  #=> "646"
  LANG=ja
    Encoding.locale_charmap  #=> "eucJP"

The result is highly platform dependent. So Encoding.find(Encoding.locale_charmap) may cause an error. If you need some encoding object even for unknown locale, Encoding.find(“locale”) can be used.

Calls the block once for each value string in the database. Returns self.

Search took: 3ms  ·  Total Results: 1179