Results for: "Dir.chdir"

No documentation available
No documentation available

See IO#getch.

See IO#readchar.

Executes the block for every line in the stream where lines are separated by eol.

See also gets

Reads a one-character string from the stream. Raises an EOFError at end of file.

Generate a Checkbox Input element as a string.

The attributes of the element can be specified as three arguments, name, value, and checked. checked is a boolean value; if true, the CHECKED attribute will be included in the element.

Alternatively, the attributes can be specified as a hash.

checkbox("name")
  # = checkbox("NAME" => "name")

checkbox("name", "value")
  # = checkbox("NAME" => "name", "VALUE" => "value")

checkbox("name", "value", true)
  # = checkbox("NAME" => "name", "VALUE" => "value", "CHECKED" => true)
No documentation available

Returns the header field corresponding to the case-insensitive key. Returns the default value args, or the result of the block, or raises an IndexError if there’s no header field named key See Hash#fetch

No documentation available

Returns “true” if the “transfer-encoding” header is present and set to “chunked”. This is an HTTP/1.1 feature, allowing the content to be sent in “chunks” without at the outset stating the entire content length.

returns a charset parameter in Content-Type field. It is downcased for canonicalization.

If charset parameter is not given but a block is given, the block is called and its result is returned. It can be used to guess charset.

If charset parameter and block is not given, nil is returned except text type. In that case, “utf-8” is returned as defined by RFC6838 4.2.1

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

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

@return [void]

@param [Conflict] conflict @return [Array] minimal array of requirements that would cause the passed

conflict to occur.

@param [Object] requirement we wish to check @param [Array] possible_binding_requirements array of requirements @param [Array] possibilities array of possibilities the requirements will be used to filter @return [Boolean] whether or not the given requirement is required to filter

out all elements of the array of possibilities.

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

this vertex

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

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

Iterates over array indexes.

When a block given, passes each successive array index to the block; returns self:

a = [:foo, 'bar', 2]
a.each_index {|index|  puts "#{index} #{a[index]}" }

Output:

0 foo
1 bar
2 2

Allows the array to be modified during iteration:

a = [:foo, 'bar', 2]
a.each_index {|index| puts index; a.clear if index > 0 }

Output:

0
1

When no block given, returns a new Enumerator:

a = [:foo, 'bar', 2]
e = a.each_index
e # => #<Enumerator: [:foo, "bar", 2]:each_index>
a1 = e.each {|index|  puts "#{index} #{a[index]}"}

Output:

0 foo
1 bar
2 2

Related: each, reverse_each.

Iterates backwards over array elements.

When a block given, passes, in reverse order, each element to the block; returns self:

a = [:foo, 'bar', 2]
a.reverse_each {|element|  puts "#{element.class} #{element}" }

Output:

Integer 2
String bar
Symbol foo

Allows the array to be modified during iteration:

a = [:foo, 'bar', 2]
a.reverse_each {|element| puts element; a.clear if element.to_s.start_with?('b') }

Output:

2
bar

When no block given, returns a new Enumerator:

a = [:foo, 'bar', 2]
e = a.reverse_each
e # => #<Enumerator: [:foo, "bar", 2]:reverse_each>
a1 = e.each {|element|  puts "#{element.class} #{element}" }

Output:

Integer 2
String bar
Symbol foo

Related: each, each_index.

Searches self as described at method bsearch, but returns the index of the found element instead of the element itself.

Search took: 11ms  ·  Total Results: 995