From: Scott Barron Date: 2006-04-16T09:17:58+09:00 Subject: Re: Bug: Requiring "breakpoint" causes the entire Rails framework to load. ------=_Part_19273_12885753.1145146675201 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 4/15/06, Mauricio Fernandez wrote: > > On Sun, Apr 16, 2006 at 05:21:41AM +0900, Florian Gro=DF wrote: > > >I'm no gems internals guru but it seems to me that when you require > > >'rubygems' all of the gems/**/lib directories are added to the path, > and > > >the > > >rails gem has a lib/breakpoint.rb. When looking at the lib directorie= s > of > > >most other gems, it looks like the rails gem has a fairly dirty lib/. > > > > Oh, it still bundles breakpoint? I guess that would be better solved by > > adding a dependency on ruby-breakpoint now that it comes with a gem. > > > > IIRC they were using slightly different default options, but if that > > really turns out to be a problem I can certainly try to address this in > > a new version of ruby-breakpoint. > > > > It's also odd that RubyGems will load the Rails version instead of the > > ruby-breakpoint one. Sounds odd. > > This is a simple conflict between the two RubyGems packages; such things > are > bound to happen with increasing frequency. > > When you do require 'breakpoint', the new Kernel#require defined by > RubyGems > searches all package directories (more precisely, the require_paths, whic= h > doesn't however help that much given the overall slowness of this > approach) > for breakpoint{,.rb,.so,.bundle,.dll,.sl} and loads the first match it > finds, > "activating" the corresponding RubyGems package in the process. > > This search is performed in alphabetical order relative to package names, > so > rails' copy (under activesupport/) will be found before ruby-breakpoint. > > As for require 'breakpoint' loading all of Rails, that's quite > surprising > since there are no explicit #require calls there, and activesupport > doesn't > use auto_require. It'd be interesting to see the "require chain", if the > OP can > provide it. > > -- > Mauricio Fernandez - http://eigenclass.org - singular Ruby > > Actually it's pulling in the one from the rails package. Its breakpoint.rblives right in lib, active support's lives in lib/active_support. Of course, 'rails' is still alphabetically before 'ruby-breakpoint', but that'= s why the framework would be loaded. -Scott ------=_Part_19273_12885753.1145146675201--