RDoc: bug or limitation?

I think I found a bug in RDoc, although this could be a limitation, I'm
not sure. Here's the code:

@@valid_services = [:rubyurl, :tinyurl, :shorl, :snipurl, :metamark,
:makeashorterlink, :skinnylink]
private_method_class(:get_short_url, *@@valid_services)

However, when I generate the doc, only ShortURL.get_short_url is makred
as a private class method, ShortURL.rubyurl and everything are marked
as public class methods.

Vincent.

RDoc parses ruby code in pretty simplified way, not execute it. Hence a lot of limitations, your case being one of them (I think).

Gennady.

···

On Jun 4, 2005, at 12:55, Vincent Foley wrote:

I think I found a bug in RDoc, although this could be a limitation, I'm
not sure. Here's the code:

@@valid_services = [:rubyurl, :tinyurl, :shorl, :snipurl, :metamark,
:makeashorterlink, :skinnylink]
private_method_class(:get_short_url, *@@valid_services)

However, when I generate the doc, only ShortURL.get_short_url is makred
as a private class method, ShortURL.rubyurl and everything are marked
as public class methods.

Vincent.

Hello Vincent,

I think I found a bug in RDoc, although this could be a limitation, I'm
not sure. Here's the code:

@@valid_services = [:rubyurl, :tinyurl, :shorl, :snipurl, :metamark,
:makeashorterlink, :skinnylink]
private_method_class(:get_short_url, *@@valid_services)

However, when I generate the doc, only ShortURL.get_short_url is makred
as a private class method, ShortURL.rubyurl and everything are marked
as public class methods.

Static source code analysers will never catch dynamic code generation.
If there is not a real reason for this code i would consider it bad
style (as it looks as ugly as Perl).

···

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's

You mean a better way is keep it simple, like:

def rubyurl
   ...
end
private :rubyurl

def tinyurl
   ...
end
private :tinyurl

def snipurl
   ...
end
private :snipurl

....

Am I right?

···

On 06/05/2005 02:30 AM, Lothar Scholz wrote:

Hello Vincent,

> I think I found a bug in RDoc, although this could be a limitation, I'm
> not sure. Here's the code:

> @@valid_services = [:rubyurl, :tinyurl, :shorl, :snipurl, :metamark,
> :makeashorterlink, :skinnylink]
> private_method_class(:get_short_url, *@@valid_services)

> However, when I generate the doc, only ShortURL.get_short_url is makred
> as a private class method, ShortURL.rubyurl and everything are marked
> as public class methods.

Static source code analysers will never catch dynamic code generation.
If there is not a real reason for this code i would consider it bad
style (as it looks as ugly as Perl).

--
Dr Balwinder Singh Dheeman Registered Linux User: #229709
CLLO (Chief Linux Learning Officer) Machines: #168573, 170593, 259192
Anu's Linux@HOME Distros: Ubuntu, Fedora, Knoppix
More: http://anu.homelinux.net/~bsd/ Visit: http://counter.li.org/

Hello Dr,

You mean a better way is keep it simple, like:

def rubyurl
   ...
end
private :rubyurl

def tinyurl
   ...
end
private :tinyurl

def snipurl
   ...
end
private :snipurl

....

Am I right?

Or better

class FooUrl
public
def rubyurl; ...; end
def tinyurl; ...; end
def snipurl; ...; end
end

I really find that 80% of the dynamic features of ruby are simply
missued.

···

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's