- 
                Notifications
    You must be signed in to change notification settings 
- Fork 445
Closed
Description
Context
- RDoc uses parser generator kpegfor its markdown parser, which readslib/markdown.kpegto outputlib/markdown.rb.
- RDoc doesn't commit the generated .rbfiles, but relies on itsgeneraterake task to generate them.
- generateis a prerequisite of the- buildtask, which is part of the- releasetask. So files like- lib/markdown.rbwill be generated and packaged as part of the gem.
However, if users install RDoc from a git/github source, those generated files will be missing, and thus cause errors.
Reproduction Steps
- Run the command below
$ bundle exec ruby -e 'require "rdoc"; require "rdoc/markdown"; puts RDoc::Markdown'
RDoc::Markdown
- Add gem "rdoc", github: "ruby/rdoc"to the Gemfile
- Run bundle install
- Run the same command again, which should now show an error like:
bundle exec ruby -e 'require "rdoc"; require "rdoc/markdown"; puts RDoc::Markdown'
/opt/rubies/3.3.0/lib/ruby/3.3.0/rdoc/markdown.rb:182:in `require': cannot load such file -- /Users/hung-wulo/.gem/ruby/3.3.0/bundler/gems/rdoc-8a68a016b25a/lib/rdoc/markdown (LoadError)
        from /opt/rubies/3.3.0/lib/ruby/3.3.0/rdoc/markdown.rb:182:in `<top (required)>'
        from -e:1:in `require'
        from -e:1:in `<main>'
Possible solutions
- Commit the generated files into the git repository too, and have a way to automatically update them when their grammar files changes.
- Utilize extconf.rbto runrake build, which will be executed every time the gem is installed (PoC).
- Rely on other markdown parsers that don't require parser generator?
Metadata
Metadata
Assignees
Labels
No labels