Fully qualifying classes underneath the vendor directory


#1

Java background?

Ruby’s concept of namespaces is different from packages in Java. Also,
there’s no need that your Node class is defined in a file called
node.rb.

In your example above, you’d need to make sure that (…)/vendor is in
your $LOAD_PATH, for example by calling ruby like this:

ruby -I(…)

and then you require the file:

require “html-scanner/html/node”

Assuming that no conflichts exists and Node isn’t in fact packed
into a namespace /module called HTML-Scanner::HTML you can now
access Node like you would any other class.

n=Node.new

That what you meant?
-tim