Creates a GzipReader
object associated with io
. The GzipReader
object reads gzipped data from io
, and parses/decompresses it. The io
must have a read
method that behaves same as the IO#read
.
The options
hash may be used to set the encoding of the data. :external_encoding
, :internal_encoding
and :encoding
may be set as in IO::new
.
If the gzip file header is incorrect, raises an Zlib::GzipFile::Error
exception.
File::Stat.new(file_name) -> stat
Create a File::Stat
object for the given file name (raising an exception if the file doesn’t exist).
Takes source
, a String of Ruby code and compiles it to an InstructionSequence
.
Optionally takes file
, path
, and line
which describe the filename, absolute path and first line number of the ruby code in source
which are metadata attached to the returned iseq
.
options
, which can be true
, false
or a Hash
, is used to modify the default behavior of the Ruby iseq compiler.
For details regarding valid compile options see ::compile_option=
.
RubyVM::InstructionSequence.compile("a = 1 + 2") #=> <RubyVM::InstructionSequence:<compiled>@<compiled>>
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.
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.
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.
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.
Creates a new GW
Create a DRb::DRbSSLSocket
instance.
uri
is the URI
we are connected to. soc
is the tcp socket we are bound to. config
is our configuration. Either a Hash
or SSLConfig
is_established
is a boolean of whether soc
is currently established
This is called automatically based on the DRb
protocol.
Creates a new TimerIdConv
which will hold objects for keeping
seconds.
Creates a new StringInputMethod
object