From: James Britt Date: 2007-08-15T03:34:10+09:00 Subject: Re: Can ri distinguish core methods from 3rd party methods? [was: Non Existent Method Dir.empty? Description via "ri"] Daniel Berger wrote: > That's an excellent point Wolfgang. There ought to be a way within ri > for a user to distinguish between a core method and a method added on > by a 3rd party library. I haven't double checked the ri options, but I > don't think there's a way. > > If not, we should probably discuss (here or on ruby-core) if it's > feasible and, if so, what the output should look like. I believe this is a known problem. (Known, at least, on the ruby-doc list, and I think discussed on ruby-talk before) Assorted libraries that ship with Ruby and alter core classes (for example, Yaml) end up having their methods listed with the default methods of core classes (for example, look at the rdocs for Array; it lists 'to_yaml' as a method.) > Or, we could collectively decide that, when modifying core classes, we > should stick a tag of some sort on the method doc itself, either so > that it shows up literally in the output, or something rdoc can latch > onto. For example, the actual comments look like this: > > # Returns whether or not +path+ is empty. Returns false if +path+ > # is not a directory, or contains any files other than '.' or '..'. > # > def self.empty?(path) > ... > end > > Perhaps I should add this at the bottom of each comment? > > # library: win32-dir > > Dunno. What do people think? It may be a reasonable quick fix, though long term ri and rdoc need to be re-written to stop producing broken docs. -- James Britt "The use of anthropomorphic terminology when dealing with computing systems is a symptom of professional immaturity." - Edsger W. Dijkstra