Forum: Ruby-core rdoc/irb incompatibilities?

Posted by Chad Woolley (Guest)
on 2008-02-08 12:51
(Received via mailing list)
Hello,

I'm new to this list, sorry if this has been covered.

In Ruby 1.8.6, there seems to be incompatibilities between rdoc and
irb (I have not tried 1.9).

Both of these commands fail:
ruby -e "require 'rdoc/parsers/parse_rb'; require 'irb/ruby-token'"
ruby -e "require 'irb/ruby-token'; require 'rdoc/parsers/parse_rb'"

Both parse_rb and ruby-token define the RubyToken module with the same
constants, and requiring both results in constant redefinition
warnings, and an undefined constant error:

/usr/local/lib/ruby/1.8/irb/ruby-token.rb:253:in `def_token':
uninitialized constant RubyToken::AlreadyDefinedToken (NameError)
/usr/local/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:273:in `def_token':
uninitialized constant RubyToken::AlreadyDefinedToken (NameError)

I encounter these sort of warnings and errors when I attempt to do
things like programatically invoking RubyGems to install more than one
gem (and rdoc) in a single interpreter session, or if I attempt to use
rdebug to debug code which requires rdoc.

There are comments in the RubyGems code (doc_manager and
install_command) which refer to similar problems with rdoc.

Any thoughts?  Is this a bug?  How can I work around other than not
using rdoc and irb together?

Thanks,
-- Chad
Posted by Eric Hodel (Guest)
on 2008-02-10 03:56
(Received via mailing list)
On Feb 8, 2008, at 03:50 AM, Chad Woolley wrote:
> In Ruby 1.8.6, there seems to be incompatibilities between rdoc and
> irb (I have not tried 1.9).
>
> Any thoughts?  Is this a bug?  How can I work around other than not
> using rdoc and irb together?

It's a bug, and I don't know if I will fix it for 1.8.  I'll fix it
for 1.9 sometime after the next release of ruby_parser.

I'll be releasing a gem of RDoc which will contain the fix.
Posted by Chad Woolley (Guest)
on 2008-02-10 07:37
(Received via mailing list)
On Feb 9, 2008 7:56 PM, Eric Hodel <drbrain@segment7.net> wrote:
> It's a bug, and I don't know if I will fix it for 1.8.  I'll fix it
> for 1.9 sometime after the next release of ruby_parser.
>
> I'll be releasing a gem of RDoc which will contain the fix.

Thanks.

What is the purpose of an RDoc gem?  Will it be an identical but
easier-to-update replacement for the RDoc in ruby-core, or will it be
different in some way?

-- Chad
Posted by Eric Hodel (Guest)
on 2008-02-10 08:29
(Received via mailing list)
On Feb 9, 2008, at 22:36 PM, Chad Woolley wrote:
> different in some way?
It'll be the same code as in Ruby's trunk, but exposed to a wider
audience for feedback and bug-finding.  Currently the code is feature
compatible, but some APIs have changed.
Posted by Chad Woolley (Guest)
on 2008-02-12 08:32
(Received via mailing list)
On Feb 9, 2008 7:56 PM, Eric Hodel <drbrain@segment7.net> wrote:
> It's a bug, and I don't know if I will fix it for 1.8.  I'll fix it
> for 1.9 sometime after the next release of ruby_parser.

Are there bugs open for these issues?  Specifically:

* irb/rdoc bug shown in this thread
* other bugs when rdoc is run multiple times, as referenced in
rubygems source comments

I'm glad to open these, if you point me to the right bug trackers...

Thanks,
-- Chad
Posted by Eric Hodel (Guest)
on 2008-02-12 09:38
(Received via mailing list)
On Feb 11, 2008, at 23:31 PM, Chad Woolley wrote:
> I'm glad to open these, if you point me to the right bug trackers...
Check the RDoc project on RubyForge.  So far I haven't looked into the
bugs there, as I've been familiarizing myself with RDoc's internals
instead.
Posted by Chad Woolley (Guest)
on 2008-02-13 11:13
(Received via mailing list)
On Feb 12, 2008 1:37 AM, Eric Hodel <drbrain@segment7.net> wrote:
> Check the RDoc project on RubyForge.  So far I haven't looked into the
> bugs there, as I've been familiarizing myself with RDoc's internals
> instead.

Here's one for the irb bug:

http://rubyforge.org/tracker/index.php?func=detail&aid=18026&group_id=627&atid=2472

There are several other open ones, not sure which ones are related to
the problems in rubygems.

Thanks,
-- Chad
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.