From: Wes Gamble Date: 2006-05-17T06:19:15+09:00 Subject: Re: Fully qualifying classes underneath the vendor directory Actually, I'm trying to resolve some mysterious namespace collision and I'm thinking that if I qualify specifically enough, I'll be able to get around it. But that doesn't appear to be the case. I have done this: HTML::Node::Tag.new(parent, line, pos, name, attributes, closing) but I still can't successfully instantiate this Tag object. I just can't believe that there is another HTML::Node::Tag class floating around. There is too much auto-magic-overloading stuff going on and I don't know where it's happening. Wes Kirk Haines wrote: > On Tuesday 16 May 2006 11:59 am, Wes Gamble wrote: >> Can I qualify classes using the first directory name under vendor? >> >> Say I have: >> >> vendor/html-scanner/html/node.rb >> >> Can I qualify the Node class using >> >> HTML-Scanner::HTML::Node? > > There is nothing automatic to make this happen. It needs extra magic > that you > would have to write yourself. > > For instance, if node.rb looked something like this: > > class Node > # Node stuff here.... > end > > Then you could write your own require-like command: > > myrequire 'vendor/html-scanner/html/node' > > That would look at that path, translate it into the desired nested > Module > statements, and then load node.rb into that space. > > Is that really what you are needing, though? What are you trying to do? > If > we know that, we may well be able to suggest a simpler approach. > > > Thanks, > > Kirk Haines -- Posted via http://www.ruby-forum.com/.