Tests for the presence of an --enable-
config or --disable-
config option. Returns true
if the enable option is given, false
if the disable option is given, and the default value otherwise.
This can be useful for adding custom definitions, such as debug information.
Example:
if enable_config("debug") $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG" end
Sets a target
name that the user can then use to configure various “with” options with on the command line by using that name. For example, if the target is set to “foo”, then the user could use the --with-foo-dir=prefix
, --with-foo-include=dir
and --with-foo-lib=dir
command line options to tell where to search for header/library files.
You may pass along additional parameters to specify default values. If one is given it is taken as default prefix
, and if two are given they are taken as “include” and “lib” defaults in that order.
In any case, the return value will be an array of determined “include” and “lib” directories, either of which can be nil if no corresponding command line option is given when no default value is specified.
Note that dir_config
only adds to the list of places to search for libraries and include files. It does not link the libraries into your application.
Returns compile/link information about an installed library in a tuple of [cflags, ldflags, libs]
, by using the command found first in the following commands:
If --with-{pkg}-config={command}
is given via command line option: {command} {option}
{pkg}-config {option}
pkg-config {option} {pkg}
Where {option} is, for instance, --cflags
.
The values obtained are appended to +$INCFLAGS+, +$CFLAGS+, +$LDFLAGS+ and +$libs+.
If an option
argument is given, the config command is invoked with the option and a stripped output string is returned without modifying any of the global values mentioned above.
The iterator version of the tsort
method. obj.tsort_each
is similar to obj.tsort.each
, but modification of obj during the iteration may lead to unexpected results.
tsort_each
returns nil
. If there is a cycle, TSort::Cyclic
is raised.
class G include TSort def initialize(g) @g = g end def tsort_each_child(n, &b) @g[n].each(&b) end def tsort_each_node(&b) @g.each_key(&b) end end graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}) graph.tsort_each {|n| p n } #=> 4 # 2 # 3 # 1
The iterator version of the TSort.tsort
method.
The graph is represented by each_node and each_child. each_node should have call
method which yields for each node in the graph. each_child should have call
method which takes a node argument and yields for each child node.
g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]} each_node = lambda {|&b| g.each_key(&b) } each_child = lambda {|n, &b| g[n].each(&b) } TSort.tsort_each(each_node, each_child) {|n| p n } #=> 4 # 2 # 3 # 1
Sets the minimum and maximum supported protocol versions. See min_version=
and max_version=
.
Determines whether the given ‘requirement` is satisfied by the given `spec`, in the context of the current `activated` dependency graph.
@param [Object] requirement @param [DependencyGraph] activated the current dependency graph in the
resolution process.
@param [Object] spec @return [Boolean] whether ‘requirement` is satisfied by `spec` in the
context of the current `activated` dependency graph.
Initiates an SSL/TLS handshake with a server. The handshake may be started after unencrypted data has been sent over the socket.
Writes string to the SSL
connection.
The X509
certificate for this socket endpoint.
Returns an Array
of SingleResponse
for this BasicResponse
.
Encodes this DH
to its PEM encoding. Note that any existing per-session public/private keys will not get encoded, just the Diffie-Hellman parameters will be encoded.
Encodes this DSA
to its PEM encoding.
cipher is an OpenSSL::Cipher
.
password is a string containing your password.
DSA.to_pem -> aString DSA.to_pem(cipher, 'mypassword') -> aString
Outputs the EC
key in PEM encoding. If cipher and pass_phrase are given they will be used to encrypt the key. cipher must be an OpenSSL::Cipher
instance. Note that encryption will only be effective for a private key, public keys will always be encoded in plain text.