Skip to content

RDoc::Parser::Ruby failure on class paths with line breaks #745

@driskell

Description

@driskell

The easiest reproducing case for this is:

print String::
  new('test')

This is valid Ruby. However, not for rdoc.

$ ruby test.rb
test
$ rdoc
Parsing sources...
100% [ 1/ 1]  test.rb
RDoc::Parser::Ruby failure around line 2 of
test.rb

  new('test')

Before reporting this, could you check that the file you're documenting
has proper syntax:

  /Users/Jason/.rvm/rubies/ruby-2.5.1/bin/ruby -c test.rb

RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.

The internal error was:

	(RDoc::Error) Invalid class or module definition: String

uh-oh! RDoc had a problem:
Invalid class or module definition: String

run with --debug for full backtrace

Versions:

$ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
$ rdoc --version
6.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions