Reads a line from the stream which is separated by eol.
Raises EOFError
if at end of file.
Reads a one-character string from the stream. Raises an EOFError
at end of file.
Reads a DER or PEM encoded string from string or io and returns an instance of the appropriate PKey
class.
string is a DER- or PEM-encoded string containing an arbitrary private or public key.
io is an instance of IO
containing a DER- or PEM-encoded arbitrary private or public key.
pwd is an optional password in case string or io is an encrypted PEM resource.
Return true
if the PRNG has been seeded with enough data, false
otherwise.
Start streaming using encoding
ad hoc workaround for broken registry
Returns a profile data report such as:
GC 1 invokes. Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC time(ms) 1 0.012 159240 212940 10647 0.00000000000001530000
Generate a Form element as a string.
method
should be either “get” or “post”, and defaults to the latter. action
defaults to the current CGI
script name. enctype
defaults to “application/x-www-form-urlencoded”.
Alternatively, the attributes can be specified as a hash.
See also multipart_form()
for forms that include file uploads.
form{ "string" } # <FORM METHOD="post" ENCTYPE="application/x-www-form-urlencoded">string</FORM> form("get") { "string" } # <FORM METHOD="get" ENCTYPE="application/x-www-form-urlencoded">string</FORM> form("get", "url") { "string" } # <FORM METHOD="get" ACTION="url" ENCTYPE="application/x-www-form-urlencoded">string</FORM> form("METHOD" => "post", "ENCTYPE" => "enctype") { "string" } # <FORM METHOD="post" ENCTYPE="enctype">string</FORM>
Generate a reset button Input element, as a String
.
This resets the values on a form to their initial values. value
is the text displayed on the button. name
is the name of this button.
Alternatively, the attributes can be specified as a hash.
reset # <INPUT TYPE="reset"> reset("reset") # <INPUT TYPE="reset" VALUE="reset"> reset("VALUE" => "reset", "ID" => "foo") # <INPUT TYPE="reset" VALUE="reset" ID="foo">
Generate a TextArea element, as a String
.
name
is the name of the textarea. cols
is the number of columns and rows
is the number of rows in the display.
Alternatively, the attributes can be specified as a hash.
The body is provided by the passed-in no-argument block
textarea("name") # = textarea("NAME" => "name", "COLS" => 70, "ROWS" => 10) textarea("name", 40, 5) # = textarea("NAME" => "name", "COLS" => 40, "ROWS" => 5)
OpenURI::OpenRead#read
([ options ]) reads a content referenced by self and returns the content as string. The string is extended with OpenURI::Meta
. The argument options
is same as OpenURI::OpenRead#open
.
Parses self
destructively in order and returns self
containing the rest arguments left unparsed.
Substitution of getopts is possible as follows. Also see OptionParser#getopts
.
def getopts(*args) ($OPT = ARGV.getopts(*args)).each do |opt, val| eval "$OPT_#{opt.gsub(/[^A-Za-z0-9_]/, '_')} = val" end rescue OptionParser::ParseError end
Adds a separated list. The list is separated by comma with breakable space, by default.
seplist
iterates the list
using iter_method
. It yields each object to the block given for seplist
. The procedure separator_proc
is called between each yields.
If the iteration is zero times, separator_proc
is not called at all.
If separator_proc
is nil or not given, +lambda { comma_breakable
}+ is used. If iter_method
is not given, :each is used.
For example, following 3 code fragments has similar effect.
q.seplist([1,2,3]) {|v| xxx v } q.seplist([1,2,3], lambda { q.comma_breakable }, :each) {|v| xxx v } xxx 1 q.comma_breakable xxx 2 q.comma_breakable xxx 3
Create a new BreakNode
node
Create a new CallOrWriteNode
node
Create a new CapturePatternNode
node
Create a new ClassVariableOrWriteNode
node
Create a new ClassVariableReadNode
node
Create a new ConstantAndWriteNode
node