Returns the path from an FTP
URI
.
RFC 1738 specifically states that the path for an FTP
URI
does not include the / which separates the URI
path from the URI
host. Example:
ftp://ftp.example.com/pub/ruby
The above URI
indicates that the client should connect to ftp.example.com then cd to pub/ruby from the initial login directory.
If you want to cd to an absolute directory, you must include an escaped / (%2F) in the path. Example:
ftp://ftp.example.com/%2Fpub/ruby
This method will then return “/pub/ruby”.
Produces the summary text. Each line of the summary is yielded to the block (without newline).
sdone
Already summarized short style options keyed hash.
ldone
Already summarized long style options keyed hash.
width
Width of left side (option part). In other words, the right side (description part) starts after width
columns.
max
Maximum width of left side -> the options are filled within max
columns.
indent
Prefix string indents all summarized lines.
Adds sw
according to sopts
, lopts
and nlopts
.
sw
OptionParser::Switch
instance to be added.
sopts
Short style option list.
lopts
Long style option list.
nlopts
Negated long style options list.
Searches key
in id
list. The result is returned or yielded if a block is given. If it isn’t found, nil is returned.
Creates the summary table, passing each line to the block
(without newline). The arguments args
are passed along to the summarize method which is called on every option.
Iterates the given block for each prime number.
Creates a new IPv6
address from arg
which may be:
Iterate over the key/value pairs:
attlist_decl.each { |attribute_name, attribute_value| ... }
This method returns a list of notations that have been declared in the internal DTD
subset. Notations in the external DTD
subset are not listed.
Method
contributed by Henrik Martensson
Retrieves a named notation. Only notations declared in the internal DTD
subset can be retrieved.
Method
contributed by Henrik Martensson
Get an array of all CData
children. IMMUTABLE
Iterates through all of the child Elements
, optionally filtering them by a given XPath
optional. If supplied, this is a String
XPath
, and is used to filter the children, so that only matching children are yielded. Note that XPaths are automatically filtered for Elements
, so that non-Element children will not be yielded
doc = Document.new '<a><b/><c/><d/>sean<b/><c/><d/></a>' doc.root.elements.each {|e|p e} #-> Yields b, c, d, b, c, d elements doc.root.elements.each('b') {|e|p e} #-> Yields b, b elements doc.root.elements.each('child::node()') {|e|p e} #-> Yields <b/>, <c/>, <d/>, <b/>, <c/>, <d/> XPath.each(doc.root, 'child::node()', &block) #-> Yields <b/>, <c/>, <d/>, sean, <b/>, <c/>, <d/>
Iterates over each attribute of an Element
, yielding the expanded name and value as a pair of Strings.
doc = Document.new '<a x="1" y="2"/>' doc.root.attributes.each {|name, value| p name+" => "+value }
Evaluates to the unnormalized value of this entity; that is, replacing all entities – both %ent; and &ent; entities. This differs from +value()+ in that value
only replaces %ent; entities.
Returns the value of this entity unprocessed – raw. This is the normalized value; that is, with all %ent; and &ent; entities intact
A predicate filters a node-set with respect to an axis to produce a new node-set. For each node in the node-set to be filtered, the PredicateExpr is evaluated with that node as the context node, with the number of nodes in the node-set as the context size, and with the proximity position of the node in the node-set with respect to the axis as the context position; if PredicateExpr evaluates to true for that node, the node is included in the new node-set; otherwise, it is not included.
A PredicateExpr is evaluated by evaluating the Expr and converting the result to a boolean. If the result is a number, the result will be converted to true if the number is equal to the context position and will be converted to false otherwise; if the result is not a number, then the result will be converted as if by a call to the boolean function. Thus a location path para is equivalent to para.