From: TRANS Date: 2007-07-23T19:03:40+09:00 Subject: Re: Import gem to Ruby 1.9 On 7/22/07, Chad Fowler wrote: > > A built-in require hook would be excellent. I'm sure I'm going to > raise some feathers here but if we're going to include RubyGems in the > distribution, what is the general feeling about just including the > RubyGems LOAD_PATH semantics as part of how #require naturally works? > That would mean either of two things: 1) #require is enhanced in C to > do the RubyGems logic of looking in the installed gems and adding to > the LOAD_PATH + requiring on match or 2) require 'rubygems' by > default. No at all. That's actually what I've been advocating. But rather than hobble two different require mechanisms, one on top of the other, we should create an improved unified mechanism -- unifying gems/ and site_lib/. That's really the way to go, though there are some considerations. 1) Efficiency. Gems adds a lot of dirs to the load path. While the normal require mechanism only has a few. When running a small script, no one wants to wait, even for 1 second, for a lib to be found. Is there a good way to address this? 2) Organization of the gems/ directory. 'cache' really doesn't belong under lib/ space at all. And 'doc' and 'specifications' I would like to see with their respective packages. GoboLinux is good for comparison of the Gem philosophy of packaging. See http://www.gobolinux.org/index.php?page=at_a_glance, for starters. What they do is add a "Resources" dir to each install version which houses system info about the project. This way we could remove the meta tier and just have gems/1.9/{package} rather than the current gems/1.8/gems/{package}. This would facilitate other packages systems to use the layout. 3) Per the last point. I'd rather see a tiered layout of 'name/version' rather than the single level 'name-version'. I realize that's a rather subjective and minor, but it helps keep the directory clean and easier to navigate. 4) The gemspec should not be crucial to using the gems repository. The only piece of info in there that I think is required is the load_paths. Most packages don't need it. So a gemspec for a package should be optional --which is necessary to be able to install a package manually or via other package systems too. T.