The great ri conversion... :)

D

Dave Thomas

--Apple-Mail-18--289853921
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed

We're in the middle of integrating RDoc/ri-style comments into the main
interpreter sources (we being Michael Granger and me, with help from Ed
Sinjiashvili). So far we're maybe 60% complete, and it's starting to
look pretty good. You can check our progress at

http://www.rubygarden.org/ruby?StillToDo

If you want to play with the results (and you're on a Unix-based box)(*)

- check out a copy of the latest Ruby from CVS.
- build and install
- in the main Ruby directory (the one containing object.c etc), type

rdoc --ri *.c

- then use 'ri' to browse the results

ri Array
ri Array.push

- You can get prettier output by enabling formatting

ri -f bs Array.select
ri -f ansi MatchData

"-f bs" does formatting using overstrikes, and works with pagers such
as "more" and "less." The "-f ansi" option uses ANSI escape sequences.
To make these work with the "less" pager, you need to tell it to allow
raw escape codes through. I run my version of less with the LESS
environment variable set as follows:

export LESS="-REX"

You can use RDoc as before to extract documentation from your own
classes (and from library classes). If you use the --ri option, this
documentation will then be accessible via 'ri'.

Right now there are some holes, and I'll be adding features and fixing
bugs over the next couple of weeks. I'm announcing this now to
encourage people to play, find issues, and come up with things to
improve. However, I'm not yet at the stage where I can deal with bugs
reports and the like. Please play with all this stuff, and in a week or
so I'll announce a release candidate, at which point I'll be soliciting
as much feedback as I can get.


Cheers

Dave

(*) Why Unix only? Because I haven't even tried it on a Windows box
yet. It might work, but then again... I _will_ try it at some point.

--Apple-Mail-18--289853921--
 
T

Thomas Uehlinger

We're in the middle of integrating RDoc/ri-style comments into the main
interpreter sources (we being Michael Granger and me, with help from Ed
Sinjiashvili). So far we're maybe 60% complete, and it's starting to
look pretty good. You can check our progress at

http://www.rubygarden.org/ruby?StillToDo

If you want to play with the results (and you're on a Unix-based box)(*)

- check out a copy of the latest Ruby from CVS.
- build and install
- in the main Ruby directory (the one containing object.c etc), type

rdoc --ri *.c

When i run this in my ruby source dir I get the following error:

uehli@ueh-t ruby $ rdoc --ri *.c

array.c: Override []
/usr/local/lib/ruby/1.9/rdoc/parsers/parse_c.rb:364: warning: character
class has `]' without escape
/usr/local/lib/ruby/1.9/rdoc/parsers/parse_c.rb:364:in
`find_override_comment': premature end of regular expression:
/Document-method:\s[].*?\n((?>.*?\*\/))/ (RegexpError)
from /usr/local/lib/ruby/1.9/rdoc/parsers/parse_c.rb:333:in
`find_body'
from /usr/local/lib/ruby/1.9/rdoc/parsers/parse_c.rb:305:in
`handle_method'
from /usr/local/lib/ruby/1.9/rdoc/parsers/parse_c.rb:256:in
`do_methods' from
/usr/local/lib/ruby/1.9/rdoc/parsers/parse_c.rb:248:in `scan'
from /usr/local/lib/ruby/1.9/rdoc/parsers/parse_c.rb:248:in
`do_methods' from
/usr/local/lib/ruby/1.9/rdoc/parsers/parse_c.rb:142:in `scan'
from /usr/local/lib/ruby/1.9/rdoc/rdoc.rb:159:in `parse_files'
from /usr/local/lib/ruby/1.9/rdoc/rdoc.rb:152:in `each'
from /usr/local/lib/ruby/1.9/rdoc/rdoc.rb:152:in `parse_files'
from /usr/local/lib/ruby/1.9/rdoc/rdoc.rb:188:in `document'
from /usr/local/bin/rdoc:63
 
D

Dave Thomas

When i run this in my ruby source dir I get the following error:

uehli@ueh-t ruby $ rdoc --ri *.c

array.c: Override []
/usr/local/lib/ruby/1.9/rdoc/parsers/parse_c.rb:364: warning: character
class has `]' without escape

Excellent! Thanks for the report. I'd never tried running with warning
enabled (which is kinda stupid, I know). This should be fixed in the
latest CVS.


Cheers

Dave
 
T

Thomas Uehlinger

Yet another thing:
When I try to rdoc --ri the _whole_ ruby source dir (which is probably
stupid), I get a seg fault:

<snip>

Generating RI...
/usr/local/lib/ruby/1.9/yaml/rubytypes.rb:315: [BUG] Segmentation fault
ruby 1.9.0 (2003-12-28) [i686-linux]

Aborted

This would, of course, not so much be related to rdoc or ri, but to ruby
itself.
Just wanted to ask whether you can reproduce it.


When i run this in my ruby source dir I get the following error:

uehli@ueh-t ruby $ rdoc --ri *.c

array.c: Override []
/usr/local/lib/ruby/1.9/rdoc/parsers/parse_c.rb:364: warning: character
class has `]' without escape

Excellent! Thanks for the report. I'd never tried running with warning
enabled (which is kinda stupid, I know). This should be fixed in the
latest CVS.


Cheers

Dave
 
T

ts

T> This would, of course, not so much be related to rdoc or ri, but to ruby
T> itself.

No, for me the problem is in syck.

Guy Decoux
 
T

Thomas Uehlinger

T> This would, of course, not so much be related to rdoc or ri, but to ruby
T> itself.

No, for me the problem is in syck.

You're right, I was just too lazy to check.
_why, are you listening?

-- Thomas Uehlinger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top