Returns an initialized Tms
object which has utime
as the user CPU time, stime
as the system CPU time, cutime
as the children’s user CPU time, cstime
as the children’s system CPU time, real
as the elapsed real time and label
as the label.
Specification
constructor. Assigns the default values to the attributes and yields itself for further initialization. Optionally takes name
and version
.
Constructs a dependency with name
and requirements
. The last argument can optionally be the dependency type, which defaults to :runtime
.
Constructs a requirement from requirements
. Requirements can be Strings, Gem::Versions, or Arrays of those. nil
and duplicate requirements are ignored. An empty set of requirements
is the same as ">= 0"
.
Creates a new Net::HTTP
object without opening a TCP connection or HTTP
session.
The address
should be a DNS hostname or IP address, the port
is the port the server operates on. If no port
is given the default port for HTTP
or HTTPS is used.
If none of the p_
arguments are given, the proxy host and port are taken from the http_proxy
environment variable (or its uppercase equivalent) if present. If the proxy requires authentication you must supply it by hand. See URI::Generic#find_proxy
for details of proxy detection from the environment. To disable proxy detection set p_addr
to nil.
If you are connecting to a custom proxy, p_addr
specifies the DNS name or IP address of the proxy host, p_port
the port to use to access the proxy, p_user
and p_pass
the username and password if authorization is required to use the proxy, and p_no_proxy hosts which do not use the proxy.
Create a new CGI::Cookie
object.
name_string
The name of the cookie; in this form, there is no domain
or expiration. The path
is gleaned from the SCRIPT_NAME
environment variable, and secure
is false.
*value
value or list of values of the cookie
options_hash
A Hash
of options to initialize this Cookie
. Possible options are:
the name of the cookie. Required.
the cookie’s value or list of values.
the path for which this cookie applies. Defaults to the the value of the SCRIPT_NAME
environment variable.
the domain for which this cookie applies.
the time at which this cookie expires, as a Time
object.
whether this cookie is a secure cookie or not (default to false). Secure cookies are only transmitted to HTTPS servers.
whether this cookie is a HttpOnly cookie or not (default to
false). HttpOnly cookies are not available to javascript.
These keywords correspond to attributes of the cookie object.
Create a new CGI::Session
object for request
.
request
is an instance of the CGI
class (see cgi.rb). option
is a hash of options for initialising this CGI::Session
instance. The following options are recognised:
the parameter name used for the session id. Defaults to ‘_session_id’.
session_id
the session id to use. If not provided, then it is retrieved from the session_key
parameter of the request, or automatically generated for a new session.
new_session
if true, force creation of a new session. If not set, a new session is only created if none currently exists. If false, a new session is never created, and if none currently exists and the session_id
option is not set, an ArgumentError
is raised.
the name of the class providing storage facilities for session state persistence. Built-in support is provided for FileStore
(the default), MemoryStore
, and PStore
(from cgi/session/pstore.rb). See the documentation for these classes for more details.
The following options are also recognised, but only apply if the session id is stored in a cookie.
the time the current session expires, as a Time
object. If not set, the session will terminate when the user’s browser is closed.
the hostname domain for which this session is valid. If not set, defaults to the hostname of the server.
if true
, this session will only work over HTTPS.
the path for which this session applies. Defaults to the directory of the CGI
script.
option
is also passed on to the session storage class initializer; see the documentation for each session storage class for the options they support.
The retrieved or created session is automatically added to request
as a cookie, and also to its output_hidden
table, which is used to add hidden input elements to forms.
WARNING the output_hidden
fields are surrounded by a <fieldset> tag in HTML 4 generation, which is not invisible on many browsers; you may wish to disable the use of fieldsets with code similar to the following (see blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/37805)
cgi = CGI.new("html4") class << cgi undef_method :fieldset end
Construct a new CSV::Row
from headers
and fields
, which are expected to be Arrays. If one Array
is shorter than the other, it will be padded with nil
objects.
The optional header_row
parameter can be set to true
to indicate, via CSV::Row.header_row?()
and CSV::Row.field_row?()
, that this is a header row. Otherwise, the row is assumes to be a field row.
A CSV::Row
object supports the following Array
methods through delegation:
empty?()
length()
size()
Construct a new CSV::Table
from array_of_rows
, which are expected to be CSV::Row
objects. All rows are assumed to have the same headers.
The optional headers
parameter can be set to Array
of headers. If headers aren’t set, headers are fetched from CSV::Row
objects. Otherwise, headers() method will return headers being set in headers argument.
A CSV::Table
object supports the following Array
methods through delegation:
empty?()
length()
size()
Creates a new entry using str
.
str
may be “*” or “all” to match any address, an IP address string to match a specific address, an IP address mask per IPAddr
, or one containing “*” to match part of an IPv4 address.
IPAddr::InvalidPrefixError
may be raised when an IP network address with an invalid netmask/prefix is given.
Creates an empty ACLList
Create a new DRbUnknownError
for the DRb::DRbUnknown
object unknown
Creates a new remote error that wraps the Exception
error
Create a new DRbUnknown
object.
buf
is a string containing a marshalled object that could not be unmarshalled. err
is the error message that was raised when the unmarshalling failed. It is used to determine the name of the unmarshalled object.
Creates a new DRbArray
that either dumps or wraps all the items in the Array
ary
so they can be loaded by a remote DRb
server.
Create a new remote object stub.
obj
is the (local) object we want to create a stub for. Normally this is nil
. uri
is the URI
of the remote object that this will be a stub for.
Create a new DRbServer instance.
uri
is the URI
to bind to. This is normally of the form ‘druby://<hostname>:<port>’ where <hostname> is a hostname of the local machine. If nil, then the system’s default hostname will be bound to, on a port selected by the system; these value can be retrieved from the uri
attribute. ‘druby:’ specifies the default dRuby transport protocol: another protocol, such as ‘drbunix:’, can be specified instead.
front
is the front object for the server, that is, the object to which remote method calls on the server will be passed. If nil, then the server will not accept remote method calls.
If config_or_acl
is a hash, it is the configuration to use for this server. The following options are recognised:
an id-to-object conversion object. This defaults to an instance of the class DRb::DRbIdConv
.
if true, all unsuccessful remote calls on objects in the server will be logged to $stdout. false by default.
the access control list for this server. See the ACL
class from the main dRuby distribution.
the maximum message size in bytes accepted by the server. Defaults to 25 MB (26214400).
the maximum number of arguments to a remote method accepted by the server. Defaults to 256.
The safe level of the DRbServer. The attribute sets $SAFE for methods performed in the main_loop. Defaults to 0.
The default values of these options can be modified on a class-wide basis by the class methods default_argc_limit, default_load_limit, default_acl, default_id_conv, and verbose=
If config_or_acl
is not a hash, but is not nil, it is assumed to be the access control list for this server. See the :tcp_acl option for more details.
If no other server is currently set as the primary server, this will become the primary server.
The server will immediately start running in its own thread.
Create a new remote object stub.
obj
is the (local) object we want to create a stub for. Normally this is nil
. uri
is the URI
of the remote object that this will be a stub for.