Bug #7944

1.9.3 can't process and generate documentation for 2.0.0 (lib/profiler.rb)

Added by Luis Lavena about 1 year ago. Updated about 1 year ago.

[ruby-core:52832]
Status:Closed
Priority:Normal
Assignee:Eric Hodel
Category:lib
Target version:next minor
ruby -v:ruby 1.9.3p385 (2013-02-06) [i386-mingw32] Backport:

Description

=begin

While working on RubyInstaller, we try to generate RDoc of Ruby source.

Using RDoc 3.12.1, we received the following:

Parsing sources...
18% [125/663] lib/profiler.rb
RDoc::Parser::Ruby failure around line 79 of
lib/profiler.rb

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

C:/Users/Luis/Tools/Ruby/ruby-1.9.3-p385-i386-mingw32/bin/ruby.exe -c lib/profiler.rb

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

The internal error was:

     (RDoc::RubyLex::Error) unknown type of %string "i"

rake aborted!
unknown type of %string "i"

When executed ruby with (({-c})) received the following:

C:\Users\Luis\Code\oneclick\rubyinstaller>ruby -v -c sandbox\ruby19\lib\profiler.rb
ruby 1.9.3p385 (2013-02-06) [i386-mingw32]
sandbox/ruby19/lib/profiler.rb:79: unknown type of %string
...CALLPROC = TracePoint.new(*%i[call ccall bcall]) {|tp| # ...
... ^
sandbox/ruby
19/lib/profiler.rb:79: syntax error, unexpected $end
...CALL
PROC = TracePoint.new(*%i[call ccall bcall]) {|tp| # ...
... ^

The syntax is OK for 2.0.0:

C:\Users\Luis\Code\oneclick\rubyinstaller>sandbox\ruby19mingw\bin\ruby -v -c sandbox\ruby1_9\lib\profiler.rb
ruby 2.0.0p0 (2013-02-24) [i386-mingw32]
Syntax OK

We can't use Ruby's 2.0 RDoc version as we need rdoc_chm gem and we are building a clean installer.

I would like to know if is possible change (({lib/profiler.rb})) to use an array of symbols instead.

Thank you
=end

History

#1 Updated by Eric Hodel about 1 year ago

Could you use an RDoc 3.x with %i support, or must you use an RDoc that comes with ruby?

I can release RDoc 3.13 with %i support if that would be sufficient.

#2 Updated by Luis Lavena about 1 year ago

  • Assignee changed from Nobuyoshi Nakada to Eric Hodel

drbrain (Eric Hodel) wrote:

Could you use an RDoc 3.x with %i support, or must you use an RDoc that comes with ruby?

I can use any version of RDoc to build the documentation, as long it can be installed in Ruby 1.9.3

I can release RDoc 3.13 with %i support if that would be sufficient.

That will be awesome, that way 1.9.3 can parse doc for Ruby 2.0

Thank you.

#3 Updated by Eric Hodel about 1 year ago

Can you verify rdoc 3.12 branch (or 3 branch, they are the same) works with rdoc_chm and %i before I release?

My simple check seems to work fine.

#4 Updated by Luis Lavena about 1 year ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Hello Eric,

Yes, branch 3.12 works perfectly!

Would you release 3.12.2 or 3.13?

Version 4.0 is too incompatible for our CHM generator.

Thank you.

#5 Updated by Eric Hodel about 1 year ago

OK, 3.12.2 is released.

Also available in: Atom PDF