From: Eric Hodel Date: 2007-11-02T12:55:26+09:00 Subject: Re: Import gem to Ruby 1.9 On Oct 24, 2007, at 18:37 , NAKAMURA, Hiroshi wrote: > Tanaka Akira wrote: >>> 1. does not have uncertain behavior. No require 'doc/index' >>> problem I wrote at [ruby-core:12792]. >> >> I agree that mine is not accurate as yours or RubyGems itself. >> >> In contrast, the disadvantage of yours are memory consumption and >> maintenance. > > Don't list 'maintenance' here. When it's good enough, RubyGems team > will do it as I wrote in [ruby-core:12810]. > >> The accuracy and memory consumption is trade off. For accuracy, >> all gemspecs must be loaded and analyzed. But it consumes memory: >> analyzer code and loaded gemspecs. >> >> Since RubyGems itself does accurate analysis, its loader can be >> conservative. I think memory consumption justify the >> conservativeness. > > We've written our thought on this trade off many times each other, > without concrete grounds. I still don't have any number to show so I > don't repeat writing my thought on this again. :-) No other comments > from ruby-core. The decision is up to core team now. > > One additional thought for akr's LoadError fallback. > > Issue #1 is for solving the problem how we map feature -> path to be > added to $LOAD_PATH. Java uses MANIFEST in jar. RubyGems uses > gemspec > in spec dir. akr's LoadError fallback uses file system wild globbing. > Default Ruby require uses file system accurately. > > Can gem command of RubyGems can create a MANIFEST in gemspec dir? > Then > akr's LoadError fallback can grep it for finding rubygems to be loaded > or not. It won't be needed as a part of RubyGems though. It could. I have considered speeding up RubyGems' require, since it scans so many paths looking for files. I never found it worthwhile to implement, since files only get required around startup time. >>> Your proposal of prelude.rb enables RubyGems. As I wrote, >>> RubyGems uses their 'version selection scheme' independent from >>> whether gem method exists or not. So you cannot use any other >>> scheme. RUBYOPT solution allow you to do the above. >> >> I can install any library under site_ruby. Does RubyGems prohibit >> it? > > I mean that you can use site_ruby but cannot use others. If you install a library under site_ruby, a duplicate installation with RubyGems will not be loaded without Kernel.gem. -- Poor workers blame their tools. Good workers build better tools. The best workers get their tools to do the work for them. -- Syndicate Wars