Finds and returns the first node that matches the supplied xpath.
The context element
The xpath to search for. If not supplied or nil, returns the first node matching ‘*’.
If supplied, a Hash
which defines a namespace mapping.
If supplied, a Hash
which maps $variables in the query to values. This can be used to avoid XPath
injection attacks or to automatically handle escaping string values.
XPath.first( node ) XPath.first( doc, "//b"} ) XPath.first( node, "a/x:b", { "x"=>"http://doofus" } ) XPath.first( node, '/book/publisher/text()=$publisher', {}, {"publisher"=>"O'Reilly"})
Performs a depth-first (document order) XPath
search, and returns the first match. This is the fastest, lightest way to return a single result.
FIXME: This method is incomplete!
Adds tuple
to the proxied TupleSpace
. See TupleSpace#write
.
Returns the first advertised TupleSpace
.
Finds a live tuple that matches template
.
Adds tuple
Whether this specification is stubbed - i.e. we have information about the gem from a stub line, without having to evaluate the entire gemspec file.
True if long
begins with the characters from short
.
Override to display a longer description of what this command does.
Invoke the command with the given list of arguments.
True if the backtrace option has been specified, or debug is on.
Writes out this config file, replacing its source.
Generates a !
line for bin_file_name
‘s wrapper copying arguments if necessary.
If the :custom_shebang config is set, then it is used as a template for how to create the shebang used for to run a gem’s executables.
The template supports 4 expansions:
$env the path to the unix env utility $ruby the path to the currently running ruby interpreter $exec the path to the gem's executable $name the name of the gem the executable is for