Results for: "Logger"

Pushes character c back onto the stream such that a subsequent buffered character read will return it.

Unlike IO#getc multiple bytes may be pushed back onto the stream.

Has no effect on unbuffered reads (such as sysread).

Closes the SSLSocket and flushes any unwritten data.

No documentation available

Returns an array of Range objects that represent the value of field 'Range', or nil if there is no such field; see Range request header:

req = Net::HTTP::Get.new(uri)
req['Range'] = 'bytes=0-99,200-299,400-499'
req.range # => [0..99, 200..299, 400..499]
req.delete('Range')
req.range # # => nil
No documentation available

Parses self destructively in order and returns self containing the rest arguments left unparsed.

Parses self destructively in permutation mode and returns self containing the rest arguments left unparsed.

Substitution of getopts is possible as follows. Also see OptionParser#getopts.

def getopts(*args)
  ($OPT = ARGV.getopts(*args)).each do |opt, val|
    eval "$OPT_#{opt.gsub(/[^A-Za-z0-9_]/, '_')} = val"
  end
rescue OptionParser::ParseError
end

Generate a random alphanumeric string.

The argument n specifies the length, in characters, of the alphanumeric string to be generated. The argument chars specifies the character list which the result is consist of.

If n is not specified or is nil, 16 is assumed. It may be larger in the future.

The result may contain A-Z, a-z and 0-9, unless chars is specified.

require 'random/formatter'

Random.alphanumeric     #=> "2BuBuLf3WfSKyQbR"
# or
prng = Random.new
prng.alphanumeric(10) #=> "i6K93NdqiH"

Random.alphanumeric(4, chars: [*"0".."9"]) #=> "2952"
# or
prng = Random.new
prng.alphanumeric(10, chars: [*"!".."/"]) #=> ",.,++%/''."

Is local fetching enabled?

No documentation available
No documentation available
No documentation available

Displays an alert statement. Asks a question if given.

Calls say with msg or the results of the block if really_verbose is true.

No documentation available

Raises a TypeError to prevent cloning.

Returns the (real) user ID of the current process.

Process.uid # => 1000

Returns the effective user ID for the current process.

Process.euid # => 501

Returns the (real) group ID for the current process:

Process.gid # => 1000

Returns the effective group ID for the current process:

Process.egid # => 500

Not available on all platforms.

No documentation available
No documentation available
No documentation available

Attempts to return an array, based on the given object.

If object is an array, returns object.

Otherwise if object responds to :to_ary. calls object.to_ary: if the return value is an array or nil, returns that value; if not, raises TypeError.

Otherwise returns nil.

Related: see Methods for Creating an Array.

Search took: 5ms  ·  Total Results: 2095