From: Stefan Rusterholz Date: 2007-07-01T23:31:18+09:00 Subject: Re: Given a class, what is the 'require' line? Swaroop C H wrote: > Hi all, > > If there's a class StringScanner, I run 'ri StringScanner' and read > the documentation on how to use it, but nowhere it mentions the > 'require' line needed, how do we usually find it out? I had to google > to find out that `require 'strscan'` is the line needed... > > When I asked about this on IRC, they said run ` egrep -r > 'StringScanner' /usr/lib/ruby/1.8`, but I was really hoping there's a > builtin way of doing it. > > Thanks, > Swaroop I'd vote for having the require line obligatory for stdlib libraries documentation. I'd also appreciate it, if at least stdlib would follow the convention for file names. Unless I'm mistaken and having filenames all lowercase of the class isn't a convention (then I'd vote for coming up with a convention). I don't think it's that hard to put a proxy file in for all unconventional libs requiring the file following the convention to keep backwards-compatibility (e.g. strscan.rb just containing a line 'require "stringscanner.rb"'). Regards Stefan -- Posted via http://www.ruby-forum.com/.