[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

ri usage

Bharat Ruparel

2/17/2007 9:18:00 PM

I am trying to learn how to use ri effectively. I was looking up
methods for an Array. If I type Array.methods.sort at the irb prompt,
it displays a whole slew of methods. If I then type "ri Array.sort" at
the command prompt then I get a brief description of it. I noticed that
Array class has an "&" method. I am trying to look it up using ri as
follows:
ri Array.&
It does not work. How do I lookup the "&" method for an Array class
using ri?

Another question related to ri is that if I type
ri Array
I get a whole lot of stuff on the Array class. It seems like the screen
buffer responds to "vi" style movement keys, e.g., CTRL-F for forward
one screen CTRL-B for one screen back,etc. I noticed that the
documentation says "&" is an Instance method and the screen prompt waits
at ":", is there any command that I can type here which will get me more
info on the desired method listed such as "&" for example?
Is there a brief how to guide available for using "ri"?
Thanks.
Bharat

--
Posted via http://www.ruby-....

4 Answers

Marcello Barnaba

2/17/2007 9:37:00 PM

0

Hi,

On Saturday 17 February 2007 22:18, Bharat Ruparel wrote:
> I am trying to learn how to use ri effectively.  I was looking up
> methods for an Array.  If I type Array.methods.sort at the irb prompt,
> it displays a whole slew of methods.  If I then type "ri Array.sort" at
> the command prompt then I get a brief description of it.  I noticed that
> Array class has an "&" method.  I am trying to look it up using ri as
> follows:
> ri Array.&

You should use # as a separator, try e.g. 'Array#&'.

> It does not work.  How do I lookup the "&" method for an Array class
> using ri?

The ri(1) manual page has some information.. but I'm sure that you'd like a
better (and way faster) tool: try fastri http://eigenclass.org/hiki...

HTH
--
pub 1024D/8D2787EF 723C 7CA3 3C19 2ACE 6E20 9CC1 9956 EB3C 8D27 87EF

Olivier

2/17/2007 9:57:00 PM

0

Le samedi 17 février 2007 22:18, Bharat Ruparel a écrit :
> I am trying to learn how to use ri effectively. I was looking up
> methods for an Array. If I type Array.methods.sort at the irb prompt,
> it displays a whole slew of methods. If I then type "ri Array.sort" at
> the command prompt then I get a brief description of it. I noticed that
> Array class has an "&" method. I am trying to look it up using ri as
> follows:
> ri Array.&
> It does not work. How do I lookup the "&" method for an Array class
> using ri?
>
> Another question related to ri is that if I type
> ri Array
> I get a whole lot of stuff on the Array class. It seems like the screen
> buffer responds to "vi" style movement keys, e.g., CTRL-F for forward
> one screen CTRL-B for one screen back,etc. I noticed that the
> documentation says "&" is an Instance method and the screen prompt waits
> at ":", is there any command that I can type here which will get me more
> info on the desired method listed such as "&" for example?
> Is there a brief how to guide available for using "ri"?
> Thanks.
> Bharat

You should surround the argument with ' or ", since "&" has a special meaning
for the shell :

ri 'Array.&'

ri --help warns about this issue, and gives the basic of its use.

--
Olivier Renaud

Bharat Ruparel

2/17/2007 10:44:00 PM

0

Thank you gents.

--
Posted via http://www.ruby-....

Edward Garson

2/18/2007 10:13:00 AM

0

hello

you should check out fastri:

http://eigenclass.org/hiki...

have fun

edward

On Feb 17, 9:18 pm, Bharat Ruparel <brupa...@mercury.com> wrote:
> I am trying to learn how to use ri effectively. I was looking up
> methods for an Array. If I type Array.methods.sort at the irb prompt,
> it displays a whole slew of methods. If I then type "ri Array.sort" at
> the command prompt then I get a brief description of it. I noticed that
> Array class has an "&" method. I am trying to look it up using ri as
> follows:
> ri Array.&
> It does not work. How do I lookup the "&" method for an Array class
> using ri?
>
> Another question related to ri is that if I type
> ri Array
> I get a whole lot of stuff on the Array class. It seems like the screen
> buffer responds to "vi" style movement keys, e.g., CTRL-F for forward
> one screen CTRL-B for one screen back,etc. I noticed that the
> documentation says "&" is an Instance method and the screen prompt waits
> at ":", is there any command that I can type here which will get me more
> info on the desired method listed such as "&" for example?
> Is there a brief how to guide available for using "ri"?
> Thanks.
> Bharat
>
> --
> Posted viahttp://www.ruby-....