Ruby 1.9 and rdoc/usage confusion

A

andrew.pennebaker

Anyone trying to run a Ruby program in Ruby 1.9 that depends on rdoc/usage will experience a generic load error.

If the user is astute and devoted enough to get the code working in 1.9, they will come across various message boards, they will see that rdoc/usage was removed from 1.9 and that users are recommended to rewrite their getopt code with OptionParser.

Again, this is only what advanced users will see. The rest will simply be confused why their Ruby program isn't working. We could clear up this confusion in a variety of ways:

* Add rdoc back into 1.9's builtin libs.
* Publish an rdoc RubyGem targeting 1.9.
* For the include and require statements for anything to do with rdoc, Ruby1.9 could intercept the statement and throw a helpful error message along the lines of "rdoc is not available in Ruby 1.9. Consider rewriting the code using OptionParser."

I prefer the middle option, just publish an rdoc RubyGem. This has the benefit of not altering any core-Ruby things in 1.9, while adding backwards compatibility for 1.8 Ruby projects. The rdoc gem could print a "Warning: Deprecated. Consider rewriting using OptionParser." message to encourage peopleto switch to the new 1.9 getopt system.

What do you think?
 

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,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top