Similar to read, but raises EOFError
at end of string instead of returning nil
, as well as IO#sysread
does.
Reads at most maxlen
bytes from the stream. If buf
is provided it must reference a string which will receive the data.
See IO#readpartial
for full details.
Return true if the PRNG has been seeded with enough data, false otherwise.
The current status of GC
profile mode.
Starts the GC
profiler.
Returns whether the form contained multipart/form-data
Escape only the tags of certain HTML elements in string
.
Takes an element or elements or array of elements. Each element is specified by the name of the element, without angle brackets. This matches both the start and the end tag of that element. The attribute list of the open tag will also be escaped (for instance, the double-quotes surrounding attribute values).
print CGI::escapeElement('<BR><A HREF="url"></A>', "A", "IMG") # "<BR><A HREF="url"></A>" print CGI::escapeElement('<BR><A HREF="url"></A>', ["A", "IMG"]) # "<BR><A HREF="url"></A>"
Undo escaping such as that done by CGI::escapeElement()
print CGI::unescapeElement( CGI::escapeHTML('<BR><A HREF="url"></A>'), "A", "IMG") # "<BR><A HREF="url"></A>" print CGI::unescapeElement( CGI::escapeHTML('<BR><A HREF="url"></A>'), ["A", "IMG"]) # "<BR><A HREF="url"></A>"
Parses self
destructively and returns self
containing the rest arguments left unparsed.
UNTESTED
This is entirely Mike Stok’s beast
If a doctype includes an ATTLIST declaration, it will cause this method to be called. The content is the declaration itself, unparsed. EG, <!ATTLIST el attr CDATA REQUIRED> will come to this method as “el attr CDATA REQUIRED”. This is the same for all of the .*decl methods.
<!ELEMENT …>
<!NOTATION …>
Called when <![CDATA[ … ]]> is encountered in a document. @p content “…”
Called when a comment is encountered. @p comment The content of the comment
Called when a comment is encountered. @p comment The content of the comment
If a doctype includes an ATTLIST declaration, it will cause this method to be called. The content is the declaration itself, unparsed. EG, <!ATTLIST el attr CDATA REQUIRED> will come to this method as “el attr CDATA REQUIRED”. This is the same for all of the .*decl methods.
<!ELEMENT …>
<!NOTATION …>
Called when <![CDATA[ … ]]> is encountered in a document. @p content “…”
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 year/month that it is planned to go away.