summaryrefslogtreecommitdiff
path: root/lib/rdoc/rdoc.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-16 04:59:24 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-16 04:59:24 +0000
commitb7528b5edb1f9148ea00ebb6151720e5943b3f0b (patch)
tree4caf55c53adb188170240f54b924892fbc5f9814 /lib/rdoc/rdoc.rb
parent97ac172d58d695305c39d555155318edb99f1ea7 (diff)
* 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
Diffstat (limited to 'lib/rdoc/rdoc.rb')
-rw-r--r--lib/rdoc/rdoc.rb17
1 files changed, 14 insertions, 3 deletions
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
@@ -101,6 +101,14 @@ class RDoc::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