Question

Simple question, what is the best way on windows to search the documentation. This time I was wanting information on 'while'(resolved now by google) but I still can't can't get ri or the chm documentation on windows to give a result to while.

If I type in the Keyword in search in the chm it doesn't return 'while' it returns many results but not 'while' same for index search.

so In installed ri.

>rdoc --all --ri

but if I search while

C:\Ruby193\bin>ri 'while'
Nothing known about .while

I would like to read from the official results. Whats the best?

Also tried ri interactive but same result.

C:\Documents and Settings\renshaw>ri -i

Enter the method name you want to look up.
You can use tab to autocomplete.
Enter a blank line to exit.

>> while
Nothing known about .while
>>
Was it helpful?

Solution

That's because ri gives you information about methods, and not language syntax. while is Ruby's keyword, just like begin. If you try you won't find anything about begin in ri. Instead you can try ri File::read for example.

OTHER TIPS

For Ruby core language keywords and topics, use the ruby: prefix.

If you ran ri ruby:while, you would get a list of pages. In that list is syntax/control_expressions.rdoc, which probably contains the information that you want.

ri ruby:control_expressions

Gives you the documentation for core Ruby control expressions (which includes while).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top