Request query as a Hash
Services req
and fills in res
Converts version
into an HTTPVersion
Closes the logger (also closes the log device associated to the logger)
Shortcut for logging an ERROR
message
Will the logger output ERROR
messages?
Changes the user for the Basic Authentication header to new_user
Call this after you have added all you handlers to the server.
This method processes a XML-RPC method call and sends the answer back to the client.
Call this after you have added all you handlers to the server.
This method processes a XML-RPC method call and sends the answer back to the client.
Call this after you have added all you handlers to the server. This method starts the server to listen for XML-RPC requests and answer them.
Returns a Hash
(not a DBM
database) created by using each value in the database as a key, with the corresponding key as its value.
Note that all values in the hash will be Strings, but the keys will be actual objects.
Returns the number of the signal that caused stat to terminate (or nil
if self was not terminated by an uncaught signal).
Returns true
if this lock is currently held by some thread.
Attempts to grab the lock and waits if it isn’t available. Raises ThreadError
if mutex
was locked by the current thread.
Releases the lock. Raises ThreadError
if mutex
wasn’t locked by the current thread.
Closes the queue. A closed queue cannot be re-opened.
After the call to close completes, the following are true:
closed?
will return true
close
will be ignored.
calling enq/push/<< will return nil.
when empty?
is false, calling deq/pop/shift will return an object from the queue as usual.
ClosedQueueError
is inherited from StopIteration
, so that you can break loop block.
Example: q = Queue.new Thread.new{ while e = q.deq # wait for nil to break loop # ... end } q.close
Returns true
if the queue is closed.
Similar to Queue#close
.
The difference is behavior with waiting enqueuing threads.
If there are waiting enqueuing threads, they are interrupted by raising ClosedQueueError(‘queue closed’).
Convert source_string and return destination_string.
source_string is assumed as a part of source. i.e. :partial_input=>true is specified internally. finish method should be used last.
ec = Encoding::Converter.new("utf-8", "euc-jp") puts ec.convert("\u3042").dump #=> "\xA4\xA2" puts ec.finish.dump #=> "" ec = Encoding::Converter.new("euc-jp", "utf-8") puts ec.convert("\xA4").dump #=> "" puts ec.convert("\xA2").dump #=> "\xE3\x81\x82" puts ec.finish.dump #=> "" ec = Encoding::Converter.new("utf-8", "iso-2022-jp") puts ec.convert("\xE3").dump #=> "".force_encoding("ISO-2022-JP") puts ec.convert("\x81").dump #=> "".force_encoding("ISO-2022-JP") puts ec.convert("\x82").dump #=> "\e$B$\"".force_encoding("ISO-2022-JP") puts ec.finish.dump #=> "\e(B".force_encoding("ISO-2022-JP")
If a conversion error occur, Encoding::UndefinedConversionError
or Encoding::InvalidByteSequenceError
is raised. Encoding::Converter#convert
doesn’t supply methods to recover or restart from these exceptions. When you want to handle these conversion errors, use Encoding::Converter#primitive_convert
.
If none is given, returns the resulting hash value of the digest, keeping the digest’s state.
If a string is given, returns the hash value for the given string, resetting the digest to the initial state before and after the process.
Returns the resulting hash value and resets the digest to the initial state.
If none is given, returns the resulting hash value of the digest in a hex-encoded form, keeping the digest’s state.
If a string is given, returns the hash value for the given string in a hex-encoded form, resetting the digest to the initial state before and after the process.
Returns the resulting hash value in a hex-encoded form and resets the digest to the initial state.