All, I have a little namespace collision here. I am trying to use both RubyfulSoup (an HTML parser - which I highly recommend by the way) and the ActionView::Helpers::TextHelper class. Within the TextHelper class, there''s an attempt to create a new "Tag" object. However, Tag is also defined in the RubyfulSoup gem and it is _this_ Tag class whose initialize method is being called (and failing of course). So, is my choice simply which Gem to hack and fully qualify the class name more? Or is there a way to force one of the modules to look for the class definition within itself instead of in the path (I doubt it but I thought I would ask)? Any other advice? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
I don''t know a solution either, but if Ruby does not have a namespace solution I think it will be a major stumbling block. I hit a name collision last week with active_rbac and tracks. Both use a table "user", and I had an instance variable named "@user" that also collided with tracks. What surprised me the most is that active_rbac actually has its MVC setup in a active_rbac subdirectory to avoid some collisions, but the user helper apparently had to live at the base of the helpers directory. The more popular engines etc. get, the more this issue is going to bite people. Greg On 5/16/06, Wes Gamble <weyus@att.net> wrote:> All, > > I have a little namespace collision here. I am trying to use both > RubyfulSoup (an HTML parser - which I highly recommend by the way) and > the ActionView::Helpers::TextHelper class. Within the TextHelper class, > there''s an attempt to create a new "Tag" object. However, Tag is also > defined in the RubyfulSoup gem and it is _this_ Tag class whose > initialize method is being called (and failing of course). > > So, is my choice simply which Gem to hack and fully qualify the class > name more? > > Or is there a way to force one of the modules to look for the class > definition within itself instead of in the path (I doubt it but I > thought I would ask)? > > Any other advice? > > Thanks, > Wes > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Greg Freemyer The Norcross Group Forensics for the 21st Century
I''m also using Rubyful Soup to do some parsing and my own Tag model is colliding with Soup''s Tag. Still haven''t found a good solution yet either. Justin On 5/16/06, Greg Freemyer <greg.freemyer@gmail.com> wrote:> > I don''t know a solution either, but if Ruby does not have a namespace > solution I think it will be a major stumbling block. > > I hit a name collision last week with active_rbac and tracks. Both > use a table "user", and I had an instance variable named "@user" that > also collided with tracks. > > What surprised me the most is that active_rbac actually has its MVC > setup in a active_rbac subdirectory to avoid some collisions, but the > user helper apparently had to live at the base of the helpers > directory. > > The more popular engines etc. get, the more this issue is going to bite > people. > > Greg > > On 5/16/06, Wes Gamble <weyus@att.net> wrote: > > All, > > > > I have a little namespace collision here. I am trying to use both > > RubyfulSoup (an HTML parser - which I highly recommend by the way) and > > the ActionView::Helpers::TextHelper class. Within the TextHelper class, > > there''s an attempt to create a new "Tag" object. However, Tag is also > > defined in the RubyfulSoup gem and it is _this_ Tag class whose > > initialize method is being called (and failing of course). > > > > So, is my choice simply which Gem to hack and fully qualify the class > > name more? > > > > Or is there a way to force one of the modules to look for the class > > definition within itself instead of in the path (I doubt it but I > > thought I would ask)? > > > > Any other advice? > > > > Thanks, > > Wes > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > Greg Freemyer > The Norcross Group > Forensics for the 21st Century > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Justin Chen Two-Bit Operation LLC http://www.twobitoperation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060602/a2bd5e6c/attachment.html
Justin Chen wrote:> I''m also using Rubyful Soup to do some parsing and my own Tag model is > colliding with Soup''s Tag. Still haven''t found a good solution yet > either. > > JustinWell, at least you can control your namespace. I had to make a local copy of Rubyful Soup to only include only part of one of the gems that it depends on. Good luck. Wes -- Posted via http://www.ruby-forum.com/.