Problem due to commit 75d15117643d17a3c3d92b41512bd7840c91705b included with 6.12.0
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- ruby
调研方向
从 doc/api/ruby/create_ruby_doc.rb 开始,尤其关注 C_Parser_Paludis#initialize,并检查 rdoc/parser.rb 中的 parser 构造路径。比较 commit 75d15117643d17a3c3d92b41512bd7840c91705b 前后的 initializer 契约,然后验证一种无需 RDoc >= 6.12 即可工作的兼容方案。当文档化的 Ruby binding 生成流程在受影响的 RDoc 版本中不再引发参数数量错误时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Ruby
- 星标
- 927
- 派生
- 467
- 平均合并
- 23 小时 47 分钟
- 30 天内合并 PR
- 12
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby/rdoc 的其他 Issue
-
RDoc 8.0.0 gem omits `doc/rdoc/example.rb`, which is referenced by the packaged markup documentation可能已有人在做 @OskarEichler 于 45 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
Regexp generated from unescaped input in #expand_class可能已有人在做 @jaynetics 于 4 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 25/100
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 68/100
维护者通常 1 天内回复
-
Wrong heading levels in generated HTML?可能已有人在做 @st0012 于 10 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 1 天内回复
相似的 Issue
-
bug f:search
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
feature
难度 2/5 1-3 小时 新手友好度 60/100
manyfold3d/manyfold#7346 · 1 条评论 ·
维护者通常 1 天内回复
-
🐞 bug pending triage
难度 2/5 1-3 小时 新手友好度 65/100
CircuitVerse/CircuitVerse#8025 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
we-promise/sure#4199 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
riscv/riscv-unified-db#2738 ·
维护者通常 1 天内回复