From b7528b5edb1f9148ea00ebb6151720e5943b3f0b Mon Sep 17 00:00:00 2001 From: drbrain Date: Thu, 16 Jun 2011 04:59:24 +0000 Subject: * lib/rdoc.rb: Import RDoc 3.7 release candidate git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/rdoc.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'lib/rdoc/rdoc.rb') diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb index 6d7c4eace6..95ba9ae8ab 100644 --- a/lib/rdoc/rdoc.rb +++ b/lib/rdoc/rdoc.rb @@ -100,6 +100,14 @@ class RDoc::RDoc @current = rdoc end + ## + # Resets all internal state + + def self.reset + RDoc::TopLevel.reset + RDoc::Parser::C.reset + end + ## # Creates a new RDoc::RDoc instance. Call #document to parse files and # generate documentation. @@ -306,8 +314,12 @@ option) # Parses +filename+ and returns an RDoc::TopLevel def parse_file filename + if defined?(Encoding) then + encoding = @options.encoding + filename = filename.encode encoding + end + @stats.add_file filename - encoding = @options.encoding if defined?(Encoding) content = RDoc::Encoding.read_file filename, encoding @@ -396,8 +408,7 @@ The internal error was: # current directory, so make sure you're somewhere writable before invoking. def document options - RDoc::TopLevel.reset - RDoc::Parser::C.reset + RDoc::RDoc.reset if RDoc::Options === options then @options = options -- cgit v1.2.3