Switches the mode of this table to row mode. All calls to indexing and iteration methods will work with rows until the mode is changed again.
This method returns the table and is safe to chain.
Gets the body text from the target and outputs it to $stdout. The target can either be specified as (uri
), or as (host
, path
, port
= 80); so:
Net::HTTP.get_print URI('http://www.example.com/index.html')
or:
Net::HTTP.get_print 'www.example.com', '/index.html'
Sets the previous sibling of this child. This can be used to insert a child before some other child.
a = Element.new("a") b = a.add_element("b") c = Element.new("c") b.previous_sibling = c # => <a><b/><c/></a>
Evaluates to the root node of the document that this element belongs to. If this element doesn’t belong to a document, but does belong to another Element
, the parent’s root will be returned, until the earliest ancestor is found.
Note that this is not the same as the document element. In the following example, <a> is the document element, and the root node is the parent node of the document element. You may ask yourself why the root node is useful: consider the doctype and XML
declaration, and any processing instructions before the document element… they are children of the root node, or siblings of the document element. The only time this isn’t true is when an Element
is created that is not part of any Document
. In this case, the ancestor that has no parent acts as the root node.
d = Document.new '<a><b><c/></b></a>' a = d[1] ; c = a[1][1] d.root_node == d # TRUE a.root_node # namely, d c.root_node # again, d
Returns the previous sibling that is an element, or nil if there is no Element
sibling prior to this one
doc = Document.new '<a><b/>text<c/></a>' doc.root.elements['c'].previous_element #-> <b/> doc.root.elements['b'].previous_element #-> nil
Generates a Source
object @param arg Either a String, or an IO
@return a Source
, or nil if a bad argument was given
Reorders an array of nodes so that they are in document order It tries to do this efficiently.
FIXME: I need to get rid of this, but the issue is that most of the XPath
interpreter functions as a filter, which means that we lose context going in and out of function calls. If I knew what the index of the nodes was, I wouldn’t have to do this. Maybe add a document IDX for each node? Problems with mutable documents. Or, rewrite everything.
Creates a socket at address
If address
is multicast address then interface_address
and multicast_interface
can be set as optional.
A created socket is bound to interface_address
. If you use IPv4 multicast then the interface of interface_address
is used as the inbound interface. If interface_address
is omitted or nil then ‘0.0.0.0’ or ‘::1’ is used.
If you use IPv6 multicast then multicast_interface
is used as the inbound interface. multicast_interface
is a network interface index. If multicast_interface
is omitted then 0 (default interface) is used.
Indicated, based on the requested domain, if local gems should be considered.
Creates a DependencyList
from the current specs.
Return a hash of predecessors. result[spec]
is an Array of gemspecs that have a dependency satisfied by the named gemspec.
Compresses indices on disk
Turn an array of [name, version, platform] into an array of NameTuple
objects.
Specifies the rdoc options to be used when generating API documentation.
Usage:
spec.rdoc_options << '--title' << 'Rake -- Ruby Make' << '--main' << 'README' << '--line-numbers'
Special loader for YAML files. When a Specification
object is loaded from a YAML file, it bypasses the normal Ruby object initialization routine (initialize). This method makes up for that and deals with gems of different ages.
input
can be anything that YAML.load() accepts: String or IO
.
Returns the full path to this spec’s documentation directory. If type
is given it will be appended to the end. For example:
spec.doc_dir # => "/path/to/gem_repo/doc/a-1" spec.doc_dir 'ri' # => "/path/to/gem_repo/doc/a-1/ri"
Sets rdoc_options
to value
, ensuring it is an array. Don’t use this, push onto the array instead.
Display an error message in a location expected to get error messages. Will ask question
if it is not nil.
Creates an error page for exception ex
with an optional backtrace