[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

What is the RDoc on File talking about?

Oliver Saunders

4/1/2008 5:11:00 PM

This really confused me - why is the RDoc for the file class talking
about ftools.rb right at the top?
http://www.ruby-doc.org/core/classes... Surely the File class is
in the standard library and most people just want to see the
documentation for that.
--
Posted via http://www.ruby-....

4 Answers

Jano Svitok

4/1/2008 7:21:00 PM

0

On Tue, Apr 1, 2008 at 7:10 PM, Oliver Saunders
<oliver.saunders@gmail.com> wrote:
> This really confused me - why is the RDoc for the file class talking
> about ftools.rb right at the top?
> http://www.ruby-doc.org/core/classes... Surely the File class is
> in the standard library and most people just want to see the
> documentation for that.

Because right now RDoc puts all File related stuff together, from all
files that modify the class.

Oliver Saunders

4/1/2008 7:33:00 PM

0

> Because right now RDoc puts all File related stuff together, from all
> files that modify the class.

Ahh OK.

I can see it lists the files the RDoc was generated from as "In:" but is
it possible to tell which methods come from where? I'd like to know
which I can use without requiring anything.
--
Posted via http://www.ruby-....

Phillip Gawlowski

4/1/2008 8:05:00 PM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Oliver Saunders wrote:
|> Because right now RDoc puts all File related stuff together, from all
|> files that modify the class.
|
| Ahh OK.
|
| I can see it lists the files the RDoc was generated from as "In:" but is
| it possible to tell which methods come from where? I'd like to know
| which I can use without requiring anything.

Not in an easy way (you could compare the methods the requiring adds,
though).

The easy way of knowing what methods are at your disposal at any given
time, is #methods with its pal #sort. This is inherited from Object
(IIRC), and you can always uses those to a) find out what methods are
available, and b) sort the output.

This is especially useful in irb.

- -- Phillip Gawlowski
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail....

iEYEARECAAYFAkfylVgACgkQbtAgaoJTgL/DuQCghvUVEjCMQ0s6wnQyV/YOVXKj
0BUAn1Uol2e+LABVZH24wYxG3vu3Hui+
=3DZJ
-----END PGP SIGNATURE-----

Christopher Dicely

4/2/2008 12:55:00 AM

0

On Tue, Apr 1, 2008 at 1:04 PM, Phillip Gawlowski
<cmdjackryan@googlemail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Oliver Saunders wrote:
> |> Because right now RDoc puts all File related stuff together, from all
> |> files that modify the class.
> |
> | Ahh OK.
> |
> | I can see it lists the files the RDoc was generated from as "In:" but is
> | it possible to tell which methods come from where? I'd like to know
> | which I can use without requiring anything.
>
> Not in an easy way (you could compare the methods the requiring adds,
> though).
>
> The easy way of knowing what methods are at your disposal at any given
> time, is #methods with its pal #sort. This is inherited from Object
> (IIRC), and you can always uses those to a) find out what methods are
> available, and b) sort the output.
>
> This is especially useful in irb.

True. Personally, using IRB, I'm fond of the construction:
puts (foo.methods - Kernel.methods).sort.join("\t")