Forum: Ruby Fully qualifying classes underneath the vendor directory

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Tim B. (Guest)
on 2006-05-16 23:48
(Received via mailing list)
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
This topic is locked and can not be replied to.