Results for: "Pathname"

Returns a hash representing named captures of self (see Named Captures):

Examples:

/(?<foo>.)(?<bar>.)/.named_captures # => {"foo"=>[1], "bar"=>[2]}
/(?<foo>.)(?<foo>.)/.named_captures # => {"foo"=>[1, 2]}
/(.)(.)/.named_captures             # => {}
No documentation available

Returns the socket path as a string.

Addrinfo.unix("/tmp/sock").unix_path       #=> "/tmp/sock"

Returns the array of captured match values at indexes (1..) if the most recent match attempt succeeded, or nil otherwise; see [Captured Match Values]:

scanner = StringScanner.new('Fri Dec 12 1975 14:39')
scanner.named_captures # => {}

pattern = /(?<wday>\w+) (?<month>\w+) (?<day>\d+) /
scanner.match?(pattern)
scanner.named_captures # => {"wday"=>"Fri", "month"=>"Dec", "day"=>"12"}

scanner.string = 'nope'
scanner.match?(pattern)
scanner.named_captures # => {"wday"=>nil, "month"=>nil, "day"=>nil}

scanner.match?(/nosuch/)
scanner.named_captures # => {}

Returns a hash of the named captures; each key is a capture name; each value is its captured string or nil:

m = /(?<foo>.)(.)(?<bar>.+)/.match("hoge")
# => #<MatchData "hoge" foo:"h" bar:"ge">
m.named_captures # => {"foo"=>"h", "bar"=>"ge"}

m = /(?<a>.)(?<b>.)/.match("01")
# => #<MatchData "01" a:"0" b:"1">
m.named_captures #=> {"a" => "0", "b" => "1"}

m = /(?<a>.)(?<b>.)?/.match("0")
# => #<MatchData "0" a:"0" b:nil>
m.named_captures #=> {"a" => "0", "b" => nil}

m = /(?<a>.)(?<a>.)/.match("01")
# => #<MatchData "01" a:"0" a:"1">
m.named_captures #=> {"a" => "1"}

If keyword argument symbolize_names is given a true value, the keys in the resulting hash are Symbols:

m = /(?<a>.)(?<a>.)/.match("01")
# => #<MatchData "01" a:"0" a:"1">
m.named_captures(symbolize_names: true) #=> {:a => "1"}

Iterates over all hostnames for address.

Iterates over all hostnames for address.

Find the full path to the executable for gem name. If the exec_name is not given, an exception will be raised, otherwise the specified executable’s path is returned. requirements allows you to specify specific gem versions.

Reset the dir and path values. The next time dir or path is requested, the values will be calculated from scratch. This is mainly used by the unit tests to provide test isolation.

Use the home and paths values for Gem.dir and Gem.path. Used mainly by the unit tests to provide environment isolation.

Default gem load path

Prefix and suffix the program filename the same as ruby.

Returns the destination encoding name as a string.

Returns the destination encoding name as a string.

Return the list of all instance variables.

No documentation available

Merges a base path base, with relative path rel, returns a modified base path.

Generates new parameters for the algorithm. algo_name is a String that represents the algorithm. The optional argument options is a Hash that specifies the options specific to the algorithm. The order of the options can be important.

A block can be passed optionally. The meaning of the arguments passed to the block varies depending on the implementation of the algorithm. The block may be called once or multiple times, or may not even be called.

For the supported options, see the documentation for the ‘openssl genpkey’ utility command.

Example

pkey = OpenSSL::PKey.generate_parameters("DSA", "dsa_paramgen_bits" => 2048)
p pkey.p.num_bits #=> 2048

Returns the short name of the cipher which may differ slightly from the original name provided.

Returns the short name of this Digest algorithm which may differ slightly from the original name provided.

Example

digest = OpenSSL::Digest.new('SHA512')
puts digest.name # => SHA512

Get the descriptive name for this engine.

OpenSSL::Engine.load
OpenSSL::Engine.engines #=> [#<OpenSSL::Engine#>, ...]
OpenSSL::Engine.engines.first.name
  #=> "RSAX engine support"

Convert path string to a class

The file name of the input.

Returns the interface name of ifaddr.

returns the socket option name as an integer.

p Socket::Option.new(:INET6, :IPV6, :RECVPKTINFO, [1].pack("i!")).optname
#=> 2
Search took: 3ms  ·  Total Results: 2303