[Rubygems-developers] Thoughts on integrating ri and rubygems

Gavin Sinclair gsinclair at soyabean.com.au
Sun Mar 28 02:12:52 EST 2004

On Sunday, March 28, 2004, 12:37:29 AM, Chad wrote:

> On Mar 27, 2004, at 8:05 AM, Gavin Sinclair wrote:

>> Hi guys,
>> I don't know if you've had previous discussions on this topic.  Here
>> are my thoughts.
>> If a person has 100 gems installed, and all of them are in a global
>> 'ri' data area, then ri is likely to be very slow for several of its
>> operations.  It's also against the rubygems policy to install things
>> in a shared area except in special cases.

> Just to clarify, this speed issue wouldn't be specific to RubyGems, 
> would it?  I mean that if someone had installed the same 100 libraries
> via the traditional means, it would still be slow.  Or, am I missing
> something?

That's quite right.  The difference is that 100 libraries installed
the traditional way probably wouldn't have ri data installed, becuase:
 - it requires manual effort
 - many libraries wouldn't have documentation anyway
 - some libraries would have 'too much' documentation (i.e. pollute
   the ri data space)

The kind of 'limited integration' I'm talking about would actually
solve all these problems.

>>   ri --gem copland           # Show all classes in that gem
>>   ri --gem copland Builder
>>   ri --gem copland build
>>   etc.                       # Run normal ri queries, but only on
>>                              # that gem
>> That requires a pretty straightforward modification to ri.

> I guess this is a question for Dave as much as it is a question for 
> RubyGems' developers.  If I were Dave, I would want to see RubyGems 
> solidify quite a bit before polluting ri with additional options and
> behavior.  Even if it did solidify, I would probably be looking for a
> way to make things more transparent.  Unfortunately, since I'm not 
> Dave, I don't have any brilliant ideas of how to make it transparent
> right now ;)

I see what you're saying, but I tend to think of the features above as
a bonus, not a compromise.  For example, if 10 installed gems modify
the String class, and their in a shared ri data space, you can't
really see who's doing what.  I don't think ri can really handle that

If ri can treat each gem separately, it actually gets a better view.

Of course, it can also do a global search, like

  ri --all-gems build

By having separate directories for each gem's ri data, ri can actually
provide very helpful output in this case:

  The following matches were found for build:
    Builder#build                      (in 'copland')
    Something#build_something          (in 'something')

Also, since Dave is offering to include RubyGems instructions in
Pickaxe II, I imagine he'd be willing to support these features, so
long as he agrees with them :)


More information about the Rubygems-developers mailing list