On Sam, 2003-12-27 at 07:30, Dave Thomas wrote:
> 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

---

uehli@ueh-t ruby $ ruby -v
ruby 1.9.0 (2003-12-27) [i686-linux]


> 
> - 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.