Creates a new HTTP response object. WEBrick::Config::HTTP is the default configuration.
Creates a new HTTP server according to config
An HTTP server uses the following attributes:
An array of access logs. See WEBrick::AccessLog
Local address for the server to bind to
Root path to serve files from
Options for the default HTTPServlet::FileHandler
The HTTP version of this server
Port to listen on
Called with a request and response before each request is serviced.
Maximum time to wait between requests
Array of alternate names for this server for virtual hosting
Name for this server for virtual hosting
Creates a new HTTPVersion
from version
.
Initializes a new logger for log_file
that outputs messages at level
or higher. log_file
can be a filename, an IO-like object that responds to <<
or nil which outputs to $stderr.
If no level is given INFO
is chosen by default
Creates a new generic server from config
. The default configuration comes from default
.
Creates a new XMLRPC::Base64
instance with string str
as the internal string. When state
is :dec
it assumes that the string str
is not in base64 format (perhaps already decoded), otherwise if state
is :enc
it decodes str
and stores it as the internal string.
Creates an object which represents the remote XML-RPC server on the given host
. If the server is CGI-based, path
is the path to the CGI-script, which will be called, otherwise (in the case of a standalone server) path
should be "/RPC2"
. port
is the port on which the XML-RPC server listens.
If proxy_host
is given, then a proxy server listening at proxy_host
is used. proxy_port
is the port of the proxy server.
Default values for host
, path
and port
are ‘localhost’, ‘/RPC2’ and ‘80’ respectively using SSL ‘443’.
If user
and password
are given, each time a request is sent, an Authorization header is sent. Currently only Basic Authentication is implemented, no Digest
.
If use_ssl
is set to true
, communication over SSL is enabled.
Parameter timeout
is the time to wait for a XML-RPC response, defaults to 30.
Creates a new XMLRPC::DateTime
instance with the parameters year
, month
, day
as date and hour
, min
, sec
as time.
Raises an ArgumentError
if a parameter is out of range, or if year
is not of the Integer
type.
Creates a new XMLRPC::FaultException
instance.
faultString
is passed to StandardError
as the msg
of the Exception
.
Creates a new XMLRPC::BasicServer
instance, which should not be done, because XMLRPC::BasicServer
is an abstract class. This method should be called from a subclass indirectly by a super
call in the initialize method.
The parameter class_delim
is used by add_handler
, see XMLRPC::BasicServer#add_handler
, when an object is added as a handler, to delimit the object-prefix and the method-name.
Creates a new XMLRPC::CGIServer
instance.
All parameters given are by-passed to XMLRPC::BasicServer.new
.
You can only create one XMLRPC::CGIServer
instance, because more than one makes no sense.
Creates a new XMLRPC::ModRubyServer
instance.
All parameters given are by-passed to XMLRPC::BasicServer.new
.
Creates a new XMLRPC::Server
instance, which is a XML-RPC server listening on the given port
and accepts requests for the given host
, which is localhost
by default.
The server is not started, to start it you have to call XMLRPC::Server#serve
.
The optional audit
and debug
parameters are obsolete!
All additionally provided parameters in *a
are by-passed to XMLRPC::BasicServer.new
.
Creates a new YAML::Store
object, which will store data in file_name
. If the file does not already exist, it will be created.
Options passed in through yaml_opts
will be used when converting the store to YAML via Hash#to_yaml()
.
Creates a new Mutex
Creates a new queue instance.
Creates a fixed-length queue with a maximum size of max
.
Creates a new condition variable instance.
possible options elements:
hash form: :invalid => nil # raise error on invalid byte sequence (default) :invalid => :replace # replace invalid byte sequence :undef => nil # raise error on undefined conversion (default) :undef => :replace # replace undefined conversion :replace => string # replacement string ("?" or "\uFFFD" if not specified) :newline => :universal # decorator for converting CRLF and CR to LF :newline => :crlf # decorator for converting LF to CRLF :newline => :cr # decorator for converting LF to CR :universal_newline => true # decorator for converting CRLF and CR to LF :crlf_newline => true # decorator for converting LF to CRLF :cr_newline => true # decorator for converting LF to CR :xml => :text # escape as XML CharData. :xml => :attr # escape as XML AttValue integer form: Encoding::Converter::INVALID_REPLACE Encoding::Converter::UNDEF_REPLACE Encoding::Converter::UNDEF_HEX_CHARREF Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR Encoding::Converter::CRLF_NEWLINE_DECORATOR Encoding::Converter::CR_NEWLINE_DECORATOR Encoding::Converter::XML_TEXT_DECORATOR Encoding::Converter::XML_ATTR_CONTENT_DECORATOR Encoding::Converter::XML_ATTR_QUOTE_DECORATOR
Encoding::Converter.new
creates an instance of Encoding::Converter
.
Source_encoding and destination_encoding
should be a string or Encoding
object.
opt should be nil, a hash or an integer.
convpath should be an array. convpath may contain
two-element arrays which contain encodings or encoding names, or
strings representing decorator names.
Encoding::Converter.new
optionally takes an option. The option should be a hash or an integer. The option hash can contain :invalid => nil, etc. The option integer should be logical-or of constants such as Encoding::Converter::INVALID_REPLACE
, etc.
Raise error on invalid byte sequence. This is a default behavior.
Replace invalid byte sequence by replacement string.
Raise an error if a character in source_encoding
is not defined in destination_encoding. This is a default behavior.
Replace undefined character in destination_encoding
with replacement string.
Specify the replacement string. If not specified, “uFFFD” is used for Unicode encodings and “?” for others.
Convert CRLF and CR to LF.
Convert LF to CRLF.
Convert LF to CR.
Escape as XML
CharData. This form can be used as a HTML 4.0 PCDATA.
‘&’ -> ‘&’
‘<’ -> ‘<’
‘>’ -> ‘>’
undefined characters in destination_encoding
-> hexadecimal CharRef such as &#xHH;
Escape as XML
AttValue. The converted result is quoted as “…”. This form can be used as a HTML 4.0 attribute value.
‘&’ -> ‘&’
‘<’ -> ‘<’
‘>’ -> ‘>’
‘“’ -> ‘"’
undefined characters in destination_encoding
-> hexadecimal CharRef such as &#xHH;
Examples:
# UTF-16BE to UTF-8 ec = Encoding::Converter.new("UTF-16BE", "UTF-8") # Usually, decorators such as newline conversion are inserted last. ec = Encoding::Converter.new("UTF-16BE", "UTF-8", :universal_newline => true) p ec.convpath #=> [[#<Encoding:UTF-16BE>, #<Encoding:UTF-8>], # "universal_newline"] # But, if the last encoding is ASCII incompatible, # decorators are inserted before the last conversion. ec = Encoding::Converter.new("UTF-8", "UTF-16BE", :crlf_newline => true) p ec.convpath #=> ["crlf_newline", # [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]] # Conversion path can be specified directly. ec = Encoding::Converter.new(["universal_newline", ["EUC-JP", "UTF-8"], ["UTF-8", "UTF-16BE"]]) p ec.convpath #=> ["universal_newline", # [#<Encoding:EUC-JP>, #<Encoding:UTF-8>], # [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
Returns a new, initialized copy of the digest object. Equivalent to digest_obj.clone().reset().
Creates an instance of OpenSSL’s buffering IO
module.