Combine two Adler-32 check values in to one. adler1
is the first Adler-32 value, adler2
is the second Adler-32 value. len2
is the length of the string used to generate adler2
.
Alias of GC.start
The version of the Marshal
format for your Ruby.
A Gem::Version
for the currently running Ruby.
Glob pattern for require-able path suffixes.
Regexp
for require-able path suffixes.
Find
rubygems plugin files in the standard location and load them
Looks for a gem dependency file at path
and activates the gems in the file if found. If the file is not found an ArgumentError
is raised.
If path
is not given the RUBYGEMS_GEMDEPS environment variable is used, but if no file is found no exception is raised.
If ‘-’ is given for path
RubyGems searches up from the current working directory for gem dependency files (gem.deps.rb, Gemfile, Isolate) and activates the gems in the first one found.
You can run this automatically when rubygems starts. To enable, set the RUBYGEMS_GEMDEPS
environment variable to either the path of your gem dependencies file or “-” to auto-discover in parent directories.
NOTE: Enabling automatic discovery on multiuser systems can lead to execution of arbitrary code when used from directories outside your control.
The home directory for the user.
Path for gems in the user’s home directory
Returns a sharable hash map of error types and spell checker objects.
Adds DidYouMean
functionality to an error using a given spell checker
Start a dRuby server locally.
The new dRuby server will become the primary server, even if another server is currently the primary server.
uri
is the URI
for the server to bind to. If nil, the server will bind to random port on the default local host name and use the default dRuby protocol.
front
is the server’s front object. This may be nil.
config
is the configuration for the new server. This may be nil.
See DRbServer::new
.
Start a dRuby server locally.
The new dRuby server will become the primary server, even if another server is currently the primary server.
uri
is the URI
for the server to bind to. If nil, the server will bind to random port on the default local host name and use the default dRuby protocol.
front
is the server’s front object. This may be nil.
config
is the configuration for the new server. This may be nil.
See DRbServer::new
.
Stop the local dRuby server.
This operates on the primary server. If there is no primary server currently running, it is a noop.
Stop the local dRuby server.
This operates on the primary server. If there is no primary server currently running, it is a noop.
Returns whether or not the given header
file can be found on your system. If found, a macro is passed as a preprocessor constant to the compiler using the header file name, in uppercase, prepended with HAVE_
.
For example, if have_header('foo.h')
returned true, then the HAVE_FOO_H
preprocessor macro would be passed to the compiler.
Instructs mkmf to search for the given header
in any of the paths
provided, and returns whether or not it was found in those paths.
If the header is found then the path it was found on is added to the list of included directories that are sent to the compiler (via the -I
switch).
Returns the convertible integer type of the given type
. You may optionally specify additional headers
to search in for the type
. convertible means actually the same type, or typedef’d from the same type.
If the type
is an integer type and the convertible type is found, the following macros are passed as preprocessor constants to the compiler using the type
name, in uppercase.
TYPEOF_
, followed by the type
name, followed by =X
where “X” is the found convertible type name.
TYP2NUM
and NUM2TYP
, where TYP
is the type
name in uppercase with replacing an _t
suffix with “T”, followed by =X
where “X” is the macro name to convert type
to an Integer
object, and vice versa.
For example, if foobar_t
is defined as unsigned long, then convertible_int("foobar_t")
would return “unsigned long”, and define these macros:
#define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG
Generates a header file consisting of the various macro definitions generated by other methods such as have_func
and have_header. These are then wrapped in a custom #ifndef
based on the header
file name, which defaults to “extconf.h”.
For example:
# extconf.rb require 'mkmf' have_func('realpath') have_header('sys/utime.h') create_header create_makefile('foo')
The above script would generate the following extconf.h file:
#ifndef EXTCONF_H #define EXTCONF_H #define HAVE_REALPATH 1 #define HAVE_SYS_UTIME_H 1 #endif
Given that the create_header
method generates a file based on definitions set earlier in your extconf.rb file, you will probably want to make this one of the last methods you call in your script.