Problem due to commit 75d15117643d17a3c3d92b41512bd7840c91705b included with 6.12.0
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ruby
- Domain
- documentation
Research direction
Start with doc/api/ruby/create_ruby_doc.rb, especially C_Parser_Paludis#initialize, and inspect the parser construction path in rdoc/parser.rb. Compare the initializer contract before and after commit 75d15117643d17a3c3d92b41512bd7840c91705b, then verify a compatibility approach that works without requiring RDoc >= 6.12. Done means the documented Ruby binding generation flow no longer raises the argument-count error across the affected RDoc versions.
Written by the indexing model from the issue text.
Description
First of all, I should add that this is not really a bug, more of an uncomfortable compatibility problem, but README encourages me to report anything I have a problem with (nice, thanks!), so here's the problem:
I have a project which inherits from RDoc::Parser::C to generate documention for its ruby bindings.
module RDoc
class C_Parser_Paludis < Parser::C
#override C_Parse
parse_files_matching(/\.(c|cc|cpp|CC)$/)
def initialize(top_level, file_name, body, options, stats)
...
super(top_level, file_name, new_body, options, stats)
end
...
end
end
begin
r = RDoc::RDoc.new
r.document(ARGV)
rescue RDoc::Error => e
$stderr.puts e.message
exit(1)
end
(Full code here: https://gitlab.exherbo.org/paludis/paludis/-/blob/master/doc/api/ruby/create_ruby_doc.rb)
After updating ruby 3.4.4 to 3.4.5, which updated rdoc from 6.10.0 to 6.14.0 I get:
RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.
The internal error was:
(ArgumentError) wrong number of arguments (given 4, expected 5)
/home/heiko/Quelltexte/git-sources/exherbo/paludis/doc/api/ruby/create_ruby_doc.rb:13:in 'initialize': wrong number of arguments (given 4, expected 5) (ArgumentError)
from /usr/x86_64-pc-linux-gnu/lib/ruby/3.4/rdoc/parser.rb:194:in 'Class#new'
from /usr/x86_64-pc-linux-gnu/lib/ruby/3.4/rdoc/parser.rb:194:in 'RDoc::Parser.for'
from /usr/x86_64-pc-linux-gnu/lib/ruby/3.4/rdoc/rdoc.rb:350:in 'RDoc::RDoc#parse_file'
from /usr/x86_64-pc-linux-gnu/lib/ruby/3.4/rdoc/rdoc.rb:406:in 'block in RDoc::RDoc#parse_files'
from /usr/x86_64-pc-linux-gnu/lib/ruby/3.4/rdoc/rdoc.rb:404:in 'Array#map'
from /usr/x86_64-pc-linux-gnu/lib/ruby/3.4/rdoc/rdoc.rb:404:in 'RDoc::RDoc#parse_files'
from /usr/x86_64-pc-linux-gnu/lib/ruby/3.4/rdoc/rdoc.rb:467:in 'RDoc::RDoc#document'
from /home/heiko/Quelltexte/git-sources/exherbo/paludis/doc/api/ruby/create_ruby_doc.rb:87:in '<main>'
This is "caused" by 75d15117643d17a3c3d92b41512bd7840c91705b, which changed initialize's signature. I could conditionalize the call to super(..), but I don't know how to do that for C_Parser_Paludis's initialize itself.
Any pointers how this could be best solved without requiring rdoc >= 6.12.0 would be very welcome.
- Dominant language
- Ruby
- Stars
- 930
- Forks
- 472
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 12
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ruby/rdoc
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
RDoc 8.0.0 gem omits `doc/rdoc/example.rb`, which is referenced by the packaged markup documentationPossibly taken @OskarEichler claimed this 80 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
markdown html excerpt includes link partsPossibly taken @anyingiit claimed this 26 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Regexp generated from unescaped input in #expand_classPossibly taken @jaynetics claimed this 39 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 25/100
Maintainers usually reply within 1 day
Similar issues
-
bug f:request-creation professional
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
mysociety/alaveteli#9733 · 1 comment ·
Maintainers usually reply within 1 day
-
needs verification
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 13 days
-
🐛 bug 👩💻 équipe CE 🧑🏭 entreprises
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
betagouv/conseillers-entreprises#4808 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100