From 9fe26ef8de1ae047a4d775ce74878a0aeb01a19b Mon Sep 17 00:00:00 2001 From: hsbt Date: Sat, 23 Dec 2017 23:33:09 +0000 Subject: Merge rdoc-6.0.1. It fixes an installation error of activerecord. https://github.com/ruby/rdoc/issues/571 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/parser/ruby.rb | 7 +++++++ lib/rdoc/rdoc.gemspec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/rdoc') diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index f1856acce8..8599f655ad 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -178,6 +178,7 @@ class RDoc::Parser::Ruby < RDoc::Parser @size = 0 @token_listeners = nil @scanner = RDoc::RipperStateLex.parse(content) + @content = content @scanner_point = 0 @prev_seek = nil @markup = @options.markup @@ -2067,6 +2068,12 @@ class RDoc::Parser::Ruby < RDoc::Parser parse_top_level_statements @top_level rescue StandardError => e + if @content.include?('<%') and @content.include?('%>') then + # Maybe, this is ERB. + $stderr.puts "\033[2KRDoc detects ERB file. Skips it for compatibility:" + $stderr.puts @file_name + return + end bytes = '' if @scanner_point >= @scanner.size diff --git a/lib/rdoc/rdoc.gemspec b/lib/rdoc/rdoc.gemspec index 57a66984fd..8c92908a66 100644 --- a/lib/rdoc/rdoc.gemspec +++ b/lib/rdoc/rdoc.gemspec @@ -8,7 +8,7 @@ end Gem::Specification.new do |s| s.name = "rdoc" s.version = RDoc::VERSION - s.date = "2017-12-05" + s.date = "2017-12-24" s.authors = [ "Eric Hodel", -- cgit v1.2.3