From 400afca88a0adb5a380925dea61220e08a04022f Mon Sep 17 00:00:00 2001 From: drbrain Date: Fri, 23 Apr 2010 02:32:20 +0000 Subject: Update to RDoc 2.5.6 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/any_method.rb | 1 - lib/rdoc/code_object.rb | 6 ++++++ lib/rdoc/generator/template/darkfish/rdoc.css | 4 +--- lib/rdoc/markup/preprocess.rb | 1 + lib/rdoc/options.rb | 2 +- lib/rdoc/parser/c.rb | 2 +- lib/rdoc/parser/ruby.rb | 2 +- lib/rdoc/parser/simple.rb | 5 ++++- 8 files changed, 15 insertions(+), 8 deletions(-) (limited to 'lib/rdoc') diff --git a/lib/rdoc/any_method.rb b/lib/rdoc/any_method.rb index d93e673215..d742daa7b8 100644 --- a/lib/rdoc/any_method.rb +++ b/lib/rdoc/any_method.rb @@ -68,7 +68,6 @@ class RDoc::AnyMethod < RDoc::CodeObject @text = text @name = name - @aref = nil @aliases = [] @block_params = nil @call_seq = nil diff --git a/lib/rdoc/code_object.rb b/lib/rdoc/code_object.rb index ea1a5eaffc..f8c4e33f7e 100644 --- a/lib/rdoc/code_object.rb +++ b/lib/rdoc/code_object.rb @@ -54,6 +54,11 @@ class RDoc::CodeObject attr_accessor :force_documentation + ## + # Hash of arbitrary metadata for this CodeObject + + attr_reader :metadata + ## # Our parent CodeObject @@ -75,6 +80,7 @@ class RDoc::CodeObject # Creates a new CodeObject that will document itself and its children def initialize + @metadata = {} @comment = '' @document_children = true diff --git a/lib/rdoc/generator/template/darkfish/rdoc.css b/lib/rdoc/generator/template/darkfish/rdoc.css index 49052f4c8d..ffe996001a 100644 --- a/lib/rdoc/generator/template/darkfish/rdoc.css +++ b/lib/rdoc/generator/template/darkfish/rdoc.css @@ -103,9 +103,7 @@ body.file p { list-style: none; } .indexpage ul :link, -.indexpage ul :visited, -.file #documentation ul :link, -.file #documentation ul :visited { +.indexpage ul :visited { font-size: 16px; } diff --git a/lib/rdoc/markup/preprocess.rb b/lib/rdoc/markup/preprocess.rb index b48f099119..f3925cc692 100644 --- a/lib/rdoc/markup/preprocess.rb +++ b/lib/rdoc/markup/preprocess.rb @@ -47,6 +47,7 @@ class RDoc::Markup::PreProcess def include_file(name, indent) if full_name = find_include_file(name) then content = File.binread full_name + # HACK determine content type and force encoding content = content.sub(/\A# .*coding[=:].*$/, '').lstrip # strip leading '#'s, but only if all lines start with them diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb index 45b69186f9..7b3a23ca5c 100644 --- a/lib/rdoc/options.rb +++ b/lib/rdoc/options.rb @@ -366,7 +366,7 @@ Usage: #{opt.program_name} [options] [names...] end end - if ignored and not quiet then + unless ignored.empty? or quiet then $stderr.puts "invalid options: #{ignored.join ', '}" $stderr.puts '(invalid options are ignored)' end diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb index 27236a3ff5..05b1e77925 100644 --- a/lib/rdoc/parser/c.rb +++ b/lib/rdoc/parser/c.rb @@ -670,7 +670,7 @@ class RDoc::Parser::C < RDoc::Parser @options.title = param '' else - warn "Unrecognized directive :#{directive}:" + context.metadata[directive] = param false end end diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index e9cdc0b83e..c8bab57607 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -404,7 +404,7 @@ class RDoc::Parser::Ruby < RDoc::Parser @options.title = param '' else - warn "Unrecognized directive :#{directive}:" + @top_level.metadata[directive] = param false end end diff --git a/lib/rdoc/parser/simple.rb b/lib/rdoc/parser/simple.rb index 37125ff299..25fa3c5159 100644 --- a/lib/rdoc/parser/simple.rb +++ b/lib/rdoc/parser/simple.rb @@ -7,6 +7,8 @@ class RDoc::Parser::Simple < RDoc::Parser parse_files_matching(//) + attr_reader :content # :nodoc: + ## # Prepare to parse a plain file @@ -16,7 +18,8 @@ class RDoc::Parser::Simple < RDoc::Parser preprocess = RDoc::Markup::PreProcess.new @file_name, @options.rdoc_include preprocess.handle @content do |directive, param| - warn "Unrecognized directive '#{directive}' in #{@file_name}" + top_level.metadata[directive] = param + false end end -- cgit v1.2.3