diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-18 21:10:47 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-18 21:10:47 +0000 |
commit | 71b4ecb3d3068c23809983e1ce556056c0d2172a (patch) | |
tree | 7a09f8601e7fb8b85452fc7a85c46c524a3a609f /lib | |
parent | dbd68031e02e0933601d6f247581aeb2d08766e5 (diff) | |
download | ruby-71b4ecb3d3068c23809983e1ce556056c0d2172a.tar.gz |
Import RDoc r104. Various test fixes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rdoc/options.rb | 6 | ||||
-rw-r--r-- | lib/rdoc/parser.rb | 5 | ||||
-rw-r--r-- | lib/rdoc/parser/ruby.rb | 6 |
3 files changed, 11 insertions, 6 deletions
diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb index 4fedb40b9c..886d9f77cd 100644 --- a/lib/rdoc/options.rb +++ b/lib/rdoc/options.rb @@ -154,7 +154,7 @@ class RDoc::Options attr_reader :webcvs - def initialize(generators) # :nodoc: + def initialize(generators = {}) # :nodoc: @op_dir = "doc" @op_name = nil @show_all = false @@ -613,8 +613,8 @@ Usage: #{opt.program_name} [options] [names...] def check_files @files.each do |f| - stat = File.stat f rescue abort("File not found: #{f}") - abort("File '#{f}' not readable") unless stat.readable? + stat = File.stat f + raise RDoc::Error, "file '#{f}' not readable" unless stat.readable? end end diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb index ea4676c626..4472a8bb7c 100644 --- a/lib/rdoc/parser.rb +++ b/lib/rdoc/parser.rb @@ -53,10 +53,13 @@ class RDoc::Parser # "new_ext" will be parsed using the same parser as "old_ext" def self.alias_extension(old_ext, new_ext) + old_ext = old_ext.sub(/^\.(.*)/, '\1') + new_ext = new_ext.sub(/^\.(.*)/, '\1') + parser = can_parse "xxx.#{old_ext}" return false unless parser - RDoc::Parser.parsers.unshift [/\.#{new_ext}$/, parser.last] + RDoc::Parser.parsers.unshift [/\.#{new_ext}$/, parser] true end diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index e00d727f9e..26757256ad 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -540,8 +540,10 @@ class RDoc::RubyLex begin tk = @OP.match(self) @space_seen = TkSPACE === tk - rescue SyntaxError - abort if @exception_on_syntax_error + rescue SyntaxError => e + raise RDoc::Error, "syntax error: #{e.message}" if + @exception_on_syntax_error + tk = TkError.new(line_no, char_no) end end while @skip_space and TkSPACE === tk |