rdoc icon indicating copy to clipboard operation
rdoc copied to clipboard

[Proposal] `bundle exec rdoc` command should work for rdoc itself

Open okuramasafumi opened this issue 1 year ago • 2 comments

Problem

Currently, running bundle exec rdoc in the repository root causes the following error:

uh-oh! RDoc had a problem:

Directory doc already exists, but it looks like it isn't an RDoc directory.

Because RDoc doesn't want to risk destroying any of your existing files,
you'll need to specify a different output directory name (using the --op <dir>
option)


run with --debug for full backtrace

Solution

That seems caused by doc directory. Inside it there's rdoc/markup_reference.rb file only. While this file seems to be processed by Rakefile, it doesn't have to exist in doc directory since the file path is hardcoded. So moving rdoc/markup_reference.rb file into some other place should be enough.

okuramasafumi avatar Jun 24 '24 13:06 okuramasafumi

You can use rake rdoc, not rdoc for that.

hsbt avatar Jun 26 '24 22:06 hsbt

@hsbt Thank you for the info. README says nothing about rake rdoc command, though, and it's weird to me that RDoc cannot run the command on README for itself. And doc/rdoc/markup_reference.rb doesn't make sense since that file is not a document. So I believe the change in #1125 worth it, although it might be hard to deal with ruby/ruby script issue.

okuramasafumi avatar Jun 27 '24 15:06 okuramasafumi

I tend to agree with @okuramasafumi here. From the original PR that introduced the file (https://github.com/ruby/rdoc/pull/824), it doesn't look like it has to be under doc, just outside lib should be enough. And not being able to run rdoc easily from the repo means that contributors and maintainers will likely test it less often, and thus make it more prone to error in the long-term.

st0012 avatar Jul 06 '24 13:07 st0012

I don't agree for that. We should use rake rdoc to generate documentation on this repository. Because rdoc need generated parser files now. So, rdoc command is not working standalone with fresh repository.

hsbt avatar Jul 09 '24 11:07 hsbt