RDoc & Proc constants

Discussion in 'Ruby' started by Jesse Merriman, Apr 27, 2007.

  1. I've been having a problem getting RDoc to recognize some Proc constants, and
    boiled it down to this:

    module Foo
    Bar = lambda do puts end

    Saw = lambda do
    puts
    end

    Tox = lambda do
    puts
    puts
    end

    Grom = lambda do
    (0..2).each do |x|
    puts x
    end
    end
    end

    When I run RDoc on this, load up the HTML, and click on Foo under Classes, only
    Bar and Saw show up. When I click on test.rb under Files, only Tox shows up.
    Shouldn't all 4 constants appear in both places? I've played around with
    different options, and XML output, and the same thing happens.

    $ rdoc -D 2>/dev/null | grep CONSTANT
    #<RubyToken::TkCONSTANT:0xb7c47658 @text="Foo", @name="Foo", @char_no=7, @line_no=1>
    #<RubyToken::TkCONSTANT:0xb7c43f1c @text="Bar", @name="Bar", @char_no=2, @line_no=2>
    #<RubyToken::TkCONSTANT:0xb7c3b6a0 @text="Saw", @name="Saw", @char_no=2, @line_no=4>
    #<RubyToken::TkCONSTANT:0xb79f17dc @text="Tox", @name="Tox", @char_no=2, @line_no=8>

    So all 4 are being recognized as constants. Google tells me there have been
    issues with multi-line constants before, but I don't know what the current
    state of affairs is. Bug, or no?

    $ rdoc --version
    RDoc V1.0.1 - 20041108
    $ ruby --version
    ruby 1.8.5 (2006-12-04 patchlevel 2) [i686-linux]


    --
    Jesse Merriman

    http://www.jessemerriman.com/
    Jesse Merriman, Apr 27, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Lozzi
    Replies:
    3
    Views:
    1,932
    David Lozzi
    Jun 1, 2005
  2. NevilleDNZ
    Replies:
    9
    Views:
    443
    NevilleDNZ
    Aug 16, 2006
  3. Dave Thomas

    RDoc now does constants

    Dave Thomas, Aug 1, 2003, in forum: Ruby
    Replies:
    2
    Views:
    97
    Hal E. Fulton
    Aug 1, 2003
  4. Jean-Hugues ROBERT

    Why no Proc##[]=() ? Why no Proc##replace() ?

    Jean-Hugues ROBERT, May 1, 2004, in forum: Ruby
    Replies:
    14
    Views:
    287
    Jean-Hugues ROBERT
    May 5, 2004
  5. Minkoo Seo

    Proc vs lambda vs proc

    Minkoo Seo, Feb 4, 2007, in forum: Ruby
    Replies:
    19
    Views:
    243
    Brian Candler
    Feb 6, 2007
Loading...

Share This Page