Generate a sequence of radio button Input elements, as a String
.
This works the same as checkbox_group()
. However, it is not valid to have more than one radiobutton in a group checked.
radio_group("name", "foo", "bar", "baz") # <INPUT TYPE="radio" NAME="name" VALUE="foo">foo # <INPUT TYPE="radio" NAME="name" VALUE="bar">bar # <INPUT TYPE="radio" NAME="name" VALUE="baz">baz radio_group("name", ["foo"], ["bar", true], "baz") # <INPUT TYPE="radio" NAME="name" VALUE="foo">foo # <INPUT TYPE="radio" CHECKED NAME="name" VALUE="bar">bar # <INPUT TYPE="radio" NAME="name" VALUE="baz">baz radio_group("name", ["1", "Foo"], ["2", "Bar", true], "Baz") # <INPUT TYPE="radio" NAME="name" VALUE="1">Foo # <INPUT TYPE="radio" CHECKED NAME="name" VALUE="2">Bar # <INPUT TYPE="radio" NAME="name" VALUE="Baz">Baz radio_group("NAME" => "name", "VALUES" => ["foo", "bar", "baz"]) radio_group("NAME" => "name", "VALUES" => [["foo"], ["bar", true], "baz"]) radio_group("NAME" => "name", "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"])
returns a Time
that represents the Last-Modified field.
Returns a list of encodings in Content-Encoding field as an array of strings.
The encodings are downcased for canonicalization.
This code is based directly on the Text
gem implementation Returns a value representing the “cost” of transforming str1 into str2
The number of bytes that are immediately available for reading.
The version requirement for this dependency request
Returns true, if circular data structures should be checked, otherwise returns false.
Checks if ios
starts with a BOM, and then consumes it and sets the external encoding. Returns the result encoding if found, or nil. If ios
is not binmode or its encoding has been set already, an exception will be raised.
File.write("bom.txt", "\u{FEFF}abc") ios = File.open("bom.txt", "rb") ios.set_encoding_by_bom #=> #<Encoding:UTF-8> File.write("nobom.txt", "abc") ios = File.open("nobom.txt", "rb") ios.set_encoding_by_bom #=> nil
Re-composes a prime factorization and returns the product.
For the decomposition:
[[p_1, e_1], [p_2, e_2], ..., [p_n, e_n]],
it returns:
p_1**e_1 * p_2**e_2 * ... * p_n**e_n.
pd
Array
of pairs of integers. Each pair consists of a prime number – a prime factor – and a natural number – its exponent (multiplicity).
Prime.int_from_prime_division([[3, 2], [5, 1]]) #=> 45 3**2 * 5 #=> 45
Return true if this spec can require file
.
Full paths in the gem to add to $LOAD_PATH
when this gem is activated.
Builds indices for RubyGems 1.2 and newer. Handles full, latest, prerelease