Calls the given block once for each byte in the stream.
pass
- string
salt
- string - should be at least 8 bytes long.
iter
- integer - should be greater than 1000. 20000 is better.
keylen
- integer
digest
- a string or OpenSSL::Digest
object.
Available in OpenSSL
>= 1.0.0.
Digests other than SHA1 may not be supported by other cryptography libraries.
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
Format a Time
object as a String using the format specified by RFC 1123.
CGI::rfc1123_date(Time.now) # Sat, 01 Jan 2000 00:00:00 GMT
Generate a sequence of checkbox elements, as a String.
The checkboxes will all have the same name
attribute. Each checkbox is followed by a label. There will be one checkbox for each value. Each value can be specified as a String, which will be used both as the value of the VALUE attribute and as the label for that checkbox. A single-element array has the same effect.
Each value can also be specified as a three-element array. The first element is the VALUE attribute; the second is the label; and the third is a boolean specifying whether this checkbox is CHECKED.
Each value can also be specified as a two-element array, by omitting either the value element (defaults to the same as the label), or the boolean checked element (defaults to false).
checkbox_group("name", "foo", "bar", "baz") # <INPUT TYPE="checkbox" NAME="name" VALUE="foo">foo # <INPUT TYPE="checkbox" NAME="name" VALUE="bar">bar # <INPUT TYPE="checkbox" NAME="name" VALUE="baz">baz checkbox_group("name", ["foo"], ["bar", true], "baz") # <INPUT TYPE="checkbox" NAME="name" VALUE="foo">foo # <INPUT TYPE="checkbox" CHECKED NAME="name" VALUE="bar">bar # <INPUT TYPE="checkbox" NAME="name" VALUE="baz">baz checkbox_group("name", ["1", "Foo"], ["2", "Bar", true], "Baz") # <INPUT TYPE="checkbox" NAME="name" VALUE="1">Foo # <INPUT TYPE="checkbox" CHECKED NAME="name" VALUE="2">Bar # <INPUT TYPE="checkbox" NAME="name" VALUE="Baz">Baz checkbox_group("NAME" => "name", "VALUES" => ["foo", "bar", "baz"]) checkbox_group("NAME" => "name", "VALUES" => [["foo"], ["bar", true], "baz"]) checkbox_group("NAME" => "name", "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"])
Generate an Image Button Input element as a string.
src
is the URL of the image to use for the button. name
is the input name. alt
is the alternative text for the image.
Alternatively, the attributes can be specified as a hash.
image_button("url") # <INPUT TYPE="image" SRC="url"> image_button("url", "name", "string") # <INPUT TYPE="image" SRC="url" NAME="name" ALT="string"> image_button("SRC" => "url", "ALT" => "string") # <INPUT TYPE="image" SRC="url" ALT="string">
Iterates through the header names and values, passing in the name and value to the code block supplied.
Returns an enumerator if no block is given.
Example:
response.header.each_header {|key,value| puts "#{key} = #{value}" }
Iterates through the header names in the header, passing each header name to the code block.
Returns an enumerator if no block is given.
Iterates through header values, passing each value to the code block.
Returns an enumerator if no block is given.
As for each_header
, except the keys are provided in capitalized form.
Note that header names are capitalized systematically; capitalization may not match that used by the remote HTTP
server in its response.
Returns an enumerator if no block is given.
Returns a content type string such as “text”. This method returns nil if Content-Type: header field does not exist.
UNTESTED
Visit all subnodes of self
recursively