Used to hide lines
The search alorithm will group lines into blocks then if those blocks are determined to represent valid code they will be hidden
Returns default port.
Returns default port.
Returns the user component after URI
decoding.
Returns the password component after URI
decoding.
Calls the given block once for each key
, value
pair in the database. Deletes all entries for which the block returns true.
Returns self
.
Invoked by Kernel#sleep
and Mutex#sleep and is expected to provide an implementation of sleeping in a non-blocking way. Implementation might register the current fiber in some list of “which fiber wait until what moment”, call Fiber.yield
to pass control, and then in close
resume the fibers whose wait period has elapsed.
Reads the file from pathname, then parses it like ::parse
, returning the root node of the abstract syntax tree.
SyntaxError
is raised if pathname’s contents are not valid Ruby syntax.
RubyVM::AbstractSyntaxTree.parse_file("my-app/app.rb") # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-31:3>
See ::parse
for explanation of keyword argument meaning and usage.
Synonym for CGI.escapeElement(str)
Returns the length of the hash value of the digest.
This method should be overridden by each implementation subclass. If not, digest_obj.digest().length() is returned.
Returns the block length of the digest.
This method is overridden by each implementation subclass.
Similar to decode with the difference that decode expects one distinct value represented in der. decode_all on the contrary decodes a sequence of sequential BER/DER values lined up in der and returns them as an array.
ders = File.binread('asn1data_seq') asn1_ary = OpenSSL::ASN1.decode_all(ders)
Generate an File
Upload Input element as a string.
The attributes of the element can be specified as three arguments, name
, size
, and maxlength
. maxlength
is the maximum length of the file’s name, not of the file’s contents.
Alternatively, the attributes can be specified as a hash.
See multipart_form()
for forms that include file uploads.
file_field("name") # <INPUT TYPE="file" NAME="name" SIZE="20"> file_field("name", 40) # <INPUT TYPE="file" NAME="name" SIZE="40"> file_field("name", 40, 100) # <INPUT TYPE="file" NAME="name" SIZE="40" MAXLENGTH="100"> file_field("NAME" => "name", "SIZE" => 40) # <INPUT TYPE="file" NAME="name" SIZE="40">
Returns the integer representing length of the value of field 'Content-Range'
, or nil
if no such field exists; see Content-Range response header:
res = Net::HTTP.get_response(hostname, '/todos/1') res['Content-Range'] # => nil res['Content-Range'] = 'bytes 0-499/1000' res.range_length # => 500
Temporarily turn off warnings. Intended for tests only.