Returns Regexp
that is default self.regexp, unless schemes
is provided. Then it is a Regexp.union
with self.pattern.
Constructs the default Hash
of patterns.
Returns Regexp
that is default self.regexp, unless schemes
is provided. Then it is a Regexp.union
with self.pattern.
Constructs the default Hash
of patterns.
The response’s HTTP status line
Finds a servlet for path
Creates the HTTPRequest
used when handling the HTTP request. Can be overridden by subclasses.
Creates the HTTPResponse
used when handling the HTTP request. Can be overridden by subclasses.
Returns an array containing the values associated with the given keys.
Calls the given block once for each key
, value
pair in the database.
Returns self
.
Returns the destination encoding as an encoding object.
Returns the one-character string which cause Encoding::UndefinedConversionError
.
ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP") begin ec.convert("\xa0") rescue Encoding::UndefinedConversionError puts $!.error_char.dump #=> "\xC2\xA0" p $!.error_char.encoding #=> #<Encoding:UTF-8> end
Returns the destination encoding as an encoding object.
Returns the corresponding ASCII compatible encoding.
Returns nil if the argument is an ASCII compatible encoding.
“corresponding ASCII compatible encoding” is an ASCII compatible encoding which can represents exactly the same characters as the given ASCII incompatible encoding. So, no conversion undefined error occurs when converting between the two encodings.
Encoding::Converter.asciicompat_encoding("ISO-2022-JP") #=> #<Encoding:stateless-ISO-2022-JP> Encoding::Converter.asciicompat_encoding("UTF-16BE") #=> #<Encoding:UTF-8> Encoding::Converter.asciicompat_encoding("UTF-8") #=> nil
Returns the destination encoding as an Encoding
object.
Parses a C prototype signature
If Hash
tymap
is provided, the return value and the arguments from the signature
are expected to be keys, and the value will be the C type to be looked up.
Example:
require 'fiddle/import' include Fiddle::CParser #=> Object parse_signature('double sum(double, double)') #=> ["sum", Fiddle::TYPE_DOUBLE, [Fiddle::TYPE_DOUBLE, Fiddle::TYPE_DOUBLE]] parse_signature('void update(void (*cb)(int code))') #=> ["update", Fiddle::TYPE_VOID, [Fiddle::TYPE_VOIDP]] parse_signature('char (*getbuffer(void))[80]') #=> ["getbuffer", Fiddle::TYPE_VOIDP, []]
Creates a class to wrap the C struct with the value ty
See also Fiddle::Importer.struct
Calls the given block once for each byte in the stream.
OpenSSL::PKCS5.pbkdf2_hmac
has been renamed to OpenSSL::KDF.pbkdf2_hmac
. This method is provided for backwards compatibility.
PKCS #5 PBKDF2 (Password-Based Key Derivation Function 2) in combination with HMAC
. Takes pass, salt and iterations, and then derives a key of length bytes.
For more information about PBKDF2, see RFC 2898 Section 5.2 (tools.ietf.org/html/rfc2898#section-5.2).
The passphrase.
The salt. Salts prevent attacks based on dictionaries of common passwords and attacks based on rainbow tables. It is a public value that can be safely stored along with the password (e.g. if the derived value is used for password storage).
The iteration count. This provides the ability to tune the algorithm. It is better to use the highest count possible for the maximum resistance to brute-force attacks.
The desired length of the derived key in octets.
The hash algorithm used with HMAC
for the PRF. May be a String
representing the algorithm name, or an instance of OpenSSL::Digest
.
Generates a mask bit for a priority level. See mask=
Returns an Array
of individual raw profile data Hashes ordered from earliest to latest by :GC_INVOKE_TIME
.
For example:
[ { :GC_TIME=>1.3000000000000858e-05, :GC_INVOKE_TIME=>0.010634999999999999, :HEAP_USE_SIZE=>289640, :HEAP_TOTAL_SIZE=>588960, :HEAP_TOTAL_OBJECTS=>14724, :GC_IS_MARKED=>false }, # ... ]
The keys mean:
:GC_TIME
:GC_INVOKE_TIME
Time
elapsed in seconds from startup to when the GC
was invoked
:HEAP_USE_SIZE
Total bytes of heap used
:HEAP_TOTAL_SIZE
Total size of heap in bytes
:HEAP_TOTAL_OBJECTS
Total number of objects
:GC_IS_MARKED
Returns true
if the GC
is in mark phase
If ruby was built with GC_PROFILE_MORE_DETAIL
, you will also have access to the following hash keys:
:GC_MARK_TIME
:GC_SWEEP_TIME
:ALLOCATE_INCREASE
:ALLOCATE_LIMIT
:HEAP_USE_PAGES
:HEAP_LIVE_OBJECTS
:HEAP_FREE_OBJECTS
:HAVE_FINALIZE