String#slice example has a syntax error
http://www.ruby-doc.org/core-1.9.3/String.html#method-i-slice has a syntax error:
Oh, I have just realized that similar problems exist in the other regexp examples on the page, not just for slice.
#5 [ruby-core:45454] Updated by nathanst (Nathan Stratton Treadway) almost 6 years ago
#6 [ruby-core:45602] Updated by nathanst (Nathan Stratton Treadway) almost 6 years ago
zzak (Zachary Scott) wrote:
I was unable to reproduce this with ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux] and rdoc 3.9.4
Could be an issue with ruby-doc.org?
More specifically, it was a problem in the HTML pages generated by RDoc v3.12 (and ruby-doc.org was indeed using that version).
Over the weekend James Britt regenerated the "core" and "std=lib" RDoc pages (for all Ruby versions) using a copy of rdoc that included this bug's ruby_lex.rb patches, so the regexp literals on those pages should be fixed now.
(The gem RDocs on the site are built separately and so they may not have been updated yet.)