Generate a Form element with multipart encoding as a String
.
Multipart encoding is used for forms that include file uploads.
action
is the action to perform. enctype
is the encoding type, which defaults to “multipart/form-data”.
Alternatively, the attributes can be specified as a hash.
multipart_form{ "string" } # <FORM METHOD="post" ENCTYPE="multipart/form-data">string</FORM> multipart_form("url") { "string" } # <FORM METHOD="post" ACTION="url" ENCTYPE="multipart/form-data">string</FORM>
Generate a Password Input element as a string.
name
is the name of the input field. value
is its default value. size
is the size of the input field display. maxlength
is the maximum length of the inputted password.
Alternatively, attributes can be specified as a hash.
password_field("name") # <INPUT TYPE="password" NAME="name" SIZE="40"> password_field("name", "value") # <INPUT TYPE="password" NAME="name" VALUE="value" SIZE="40"> password_field("password", "value", 80, 200) # <INPUT TYPE="password" NAME="name" VALUE="value" SIZE="80" MAXLENGTH="200"> password_field("NAME" => "name", "VALUE" => "value") # <INPUT TYPE="password" NAME="name" VALUE="value">
Generate a Select element as a string.
name
is the name of the element. The values
are the options that can be selected from the Select menu. Each value can be a String
or a one, two, or three-element Array
. If a String
or a one-element Array
, this is both the value of that option and the text displayed for it. If a three-element Array
, the elements are the option value, displayed text, and a boolean value specifying whether this option starts as selected. The two-element version omits either the option value (defaults to the same as the display text) or the boolean selected specifier (defaults to false).
The attributes and options can also be specified as a hash. In this case, options are specified as an array of values as described above, with the hash key of “VALUES”.
popup_menu("name", "foo", "bar", "baz") # <SELECT NAME="name"> # <OPTION VALUE="foo">foo</OPTION> # <OPTION VALUE="bar">bar</OPTION> # <OPTION VALUE="baz">baz</OPTION> # </SELECT> popup_menu("name", ["foo"], ["bar", true], "baz") # <SELECT NAME="name"> # <OPTION VALUE="foo">foo</OPTION> # <OPTION VALUE="bar" SELECTED>bar</OPTION> # <OPTION VALUE="baz">baz</OPTION> # </SELECT> popup_menu("name", ["1", "Foo"], ["2", "Bar", true], "Baz") # <SELECT NAME="name"> # <OPTION VALUE="1">Foo</OPTION> # <OPTION SELECTED VALUE="2">Bar</OPTION> # <OPTION VALUE="Baz">Baz</OPTION> # </SELECT> popup_menu("NAME" => "name", "SIZE" => 2, "MULTIPLE" => true, "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"]) # <SELECT NAME="name" MULTIPLE SIZE="2"> # <OPTION VALUE="1">Foo</OPTION> # <OPTION SELECTED VALUE="2">Bar</OPTION> # <OPTION VALUE="Baz">Baz</OPTION> # </SELECT>
Returns an Integer
object which represents the HTTP
Content-Length: header field, or nil
if that field was not provided.
The length of the range represented in Content-Range: header.
Set
the Authorization: header for “Basic” authorization.
Creates an unsigned certificate for subject
and key
. The lifetime of the key is from the current time to age
which defaults to one year.
The extensions
restrict the key to the indicated uses.
Creates a new key pair of the specified algorithm
. RSA, DSA, and EC are supported.
Enumerates the trusted certificates via Gem::Security::TrustDir
.
Simple deprecation method that deprecates name
by wrapping it up in a dummy method. It warns on each call to the dummy method telling the user of repl
(unless repl
is :none) and the Rubygems version that it is planned to go away.
Simple deprecation method that deprecates name
by wrapping it up in a dummy method. It warns on each call to the dummy method telling the user of repl
(unless repl
is :none) and the Rubygems version that it is planned to go away.
If response
is an HTTP Success (2XX) response, yields the response if a block was given or shows the response body to the user.
If the response was not successful, shows an error to the user including the error_prefix
and the response body. If the response was a permanent redirect, shows an error to the user including the redirect location.
Wraps text
to wrap
characters and optionally indents by indent
characters
Enumerates the parents of directory
.
@param [Object] possibility a single possibility @param [Array] requirements an array of requirements @return [Boolean] whether the possibility satisfies all of the
given requirements
Attempts to activate the current {#possibility} @return [void]