summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-18 21:10:47 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-18 21:10:47 +0000
commitfb725b03699e7193d7112370e58a7de5e28c1f17 (patch)
tree7a09f8601e7fb8b85452fc7a85c46c524a3a609f /lib
parent769aaa9d68acc99cc61672c616673b050f43848f (diff)
downloadruby-fb725b03699e7193d7112370e58a7de5e28c1f17.tar.gz
ruby-fb725b03699e7193d7112370e58a7de5e28c1f17.tar.xz
ruby-fb725b03699e7193d7112370e58a7de5e28c1f17.zip
Import RDoc r104. Various test fixes.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/options.rb6
-rw-r--r--lib/rdoc/parser.rb5
-rw-r--r--lib/rdoc/parser/ruby.rb6
3 files changed, 11 insertions, 6 deletions
diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb
index 4fedb40b9..886d9f77c 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 ea4676c62..4472a8bb7 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 e00d727f9..26757256a 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