Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Problem due to commit 75d15117643d17a3c3d92b41512bd7840c91705b included with 6.12.0

Đang mở
#1,394 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
ruby
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu với doc/api/ruby/create_ruby_doc.rb, đặc biệt là C_Parser_Paludis#initialize, và kiểm tra đường dẫn khởi tạo parser trong rdoc/parser.rb. So sánh hợp đồng của initializer trước và sau commit 75d15117643d17a3c3d92b41512bd7840c91705b, sau đó xác minh một phương án tương thích có thể hoạt động mà không yêu cầu RDoc >= 6.12. Được xem là hoàn tất khi quy trình tạo Ruby binding được tài liệu hóa không còn phát sinh lỗi về số lượng đối số trên các phiên bản RDoc bị ảnh hưởng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Ruby
Star
927
Fork
467
Merge trung bình
23 giờ 47 phút
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ruby/rdoc

Tất cả issue của ruby/rdoc

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.