Results for: "fnmatch"

Returns an enumerator which iterates over each line (separated by sep, which defaults to your platform’s newline character) of each file in ARGV. If a block is supplied, each line in turn will be yielded to the block, otherwise an enumerator is returned. The optional limit argument is an Integer specifying the maximum length of each line; longer lines will be split according to this limit.

This method allows you to treat the files supplied on the command line as a single file consisting of the concatenation of each named file. After the last line of the first file has been returned, the first line of the second file is returned. The ARGF.filename and ARGF.lineno methods can be used to determine the filename of the current line and line number of the whole input, respectively.

For example, the following code prints out each line of each named file prefixed with its line number, displaying the filename once per file:

ARGF.each_line do |line|
  puts ARGF.filename if ARGF.file.lineno == 1
  puts "#{ARGF.file.lineno}: #{line}"
end

While the following code prints only the first file’s name at first, and the contents with line number counted through all named files.

ARGF.each_line do |line|
  puts ARGF.filename if ARGF.lineno == 1
  puts "#{ARGF.lineno}: #{line}"
end

Iterates over each byte of each file in ARGV. A byte is returned as an Integer in the range 0..255.

This method allows you to treat the files supplied on the command line as a single file consisting of the concatenation of each named file. After the last byte of the first file has been returned, the first byte of the second file is returned. The ARGF.filename method can be used to determine the filename of the current byte.

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

For example:

ARGF.bytes.to_a  #=> [35, 32, ... 95, 10]

Iterates over each codepoint of each file in ARGF.

This method allows you to treat the files supplied on the command line as a single file consisting of the concatenation of each named file. After the last codepoint of the first file has been returned, the first codepoint of the second file is returned. The ARGF.filename method can be used to determine the name of the file in which the current codepoint appears.

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

Return the accept character set for all new CGI instances.

Set the accept character set for all new CGI instances.

This method is a shortcut for converting a single row (Array) into a CSV String.

The options parameter can be anything CSV::new() understands. This method understands an additional :encoding parameter to set the base Encoding for the output. This method will try to guess your Encoding from the first non-nil field in row, if possible, but you may need to use this parameter as a backup plan.

The :row_sep option defaults to $INPUT_RECORD_SEPARATOR ($/) when calling this method.

Stores the indicated separators for later use.

If auto-discovery was requested for @row_sep, this method will read ahead in the @io and try to find one. ARGF, STDIN, STDOUT, STDERR and any stream open for output only with a default @row_sep of $INPUT_RECORD_SEPARATOR ($/).

This method also establishes the quoting rules used for CSV output.

Serialization support for the object returned by _getobj_.

Reinitializes delegation from a serialized object.

Creates a new compiler for ERB. See ERB::Compiler.new for details

‘each_option’ is an alias of ‘each’.

Returns true if the ipaddr is an IPv4-mapped IPv6 address.

Returns true if the ipaddr is an IPv4-compatible IPv6 address.

No documentation available

Returns a new ipaddr built by converting the native IPv4 address into an IPv4-mapped IPv6 address.

Returns a new ipaddr built by converting the native IPv4 address into an IPv4-compatible IPv6 address.

No documentation available

Hadamard product

Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]])
  => 1  4
     9  8
No documentation available
No documentation available
mtch.values_at([index]*)   -> array

Uses each index to access the matching values, returning an array of the corresponding matches.

m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie")
m.to_a               #=> ["HX1138", "H", "X", "113", "8"]
m.values_at(0, 2, -2)   #=> ["HX1138", "X", "113"]

m = /(?<a>\d+) *(?<op>[+\-*\/]) *(?<b>\d+)/.match("1 + 2")
m.to_a               #=> ["1 + 2", "1", "+", "2"]
m.values_at(:a, :b, :op) #=> ["1", "2", "+"]

Load the given PStore file. If read_only is true, the unmarshalled Hash will be returned. If read_only is false, a 3-tuple will be returned: the unmarshalled Hash, a checksum of the data, and the size of the data.

No documentation available

Ensures that names only includes names for the :rdoc, :clobber_rdoc and :rerdoc. If other names are given an ArgumentError is raised.

Iterates over all IP addresses for name.

Search took: 4ms  ·  Total Results: 2085