mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to RDoc 2.5.6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
30014a6156
commit
400afca88a
16 changed files with 69 additions and 12 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Fri Apr 23 11:31:25 2010 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
|
* lib/rdoc: Update to RDoc 2.5.6.
|
||||||
|
|
||||||
Fri Apr 23 04:11:26 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Apr 23 04:11:26 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* test/ripper/test_parser_events.rb (test_unterminated_regexp):
|
* test/ripper/test_parser_events.rb (test_unterminated_regexp):
|
||||||
|
|
2
NEWS
2
NEWS
|
@ -211,7 +211,7 @@ with all sufficient information, see the ChangeLog file.
|
||||||
|
|
||||||
* RDoc
|
* RDoc
|
||||||
|
|
||||||
* Updated to RDoc 2.5.5
|
* Updated to RDoc 2.5.6
|
||||||
|
|
||||||
* logger
|
* logger
|
||||||
|
|
||||||
|
|
|
@ -383,7 +383,7 @@ module RDoc
|
||||||
##
|
##
|
||||||
# RDoc version you are using
|
# RDoc version you are using
|
||||||
|
|
||||||
VERSION = '2.5.5'
|
VERSION = '2.5.6'
|
||||||
|
|
||||||
##
|
##
|
||||||
# Name of the dotfile that contains the description of files to be processed
|
# Name of the dotfile that contains the description of files to be processed
|
||||||
|
|
|
@ -68,7 +68,6 @@ class RDoc::AnyMethod < RDoc::CodeObject
|
||||||
@text = text
|
@text = text
|
||||||
@name = name
|
@name = name
|
||||||
|
|
||||||
@aref = nil
|
|
||||||
@aliases = []
|
@aliases = []
|
||||||
@block_params = nil
|
@block_params = nil
|
||||||
@call_seq = nil
|
@call_seq = nil
|
||||||
|
|
|
@ -54,6 +54,11 @@ class RDoc::CodeObject
|
||||||
|
|
||||||
attr_accessor :force_documentation
|
attr_accessor :force_documentation
|
||||||
|
|
||||||
|
##
|
||||||
|
# Hash of arbitrary metadata for this CodeObject
|
||||||
|
|
||||||
|
attr_reader :metadata
|
||||||
|
|
||||||
##
|
##
|
||||||
# Our parent CodeObject
|
# Our parent CodeObject
|
||||||
|
|
||||||
|
@ -75,6 +80,7 @@ class RDoc::CodeObject
|
||||||
# Creates a new CodeObject that will document itself and its children
|
# Creates a new CodeObject that will document itself and its children
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
|
@metadata = {}
|
||||||
@comment = ''
|
@comment = ''
|
||||||
|
|
||||||
@document_children = true
|
@document_children = true
|
||||||
|
|
|
@ -103,9 +103,7 @@ body.file p {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
.indexpage ul :link,
|
.indexpage ul :link,
|
||||||
.indexpage ul :visited,
|
.indexpage ul :visited {
|
||||||
.file #documentation ul :link,
|
|
||||||
.file #documentation ul :visited {
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ class RDoc::Markup::PreProcess
|
||||||
def include_file(name, indent)
|
def include_file(name, indent)
|
||||||
if full_name = find_include_file(name) then
|
if full_name = find_include_file(name) then
|
||||||
content = File.binread full_name
|
content = File.binread full_name
|
||||||
|
# HACK determine content type and force encoding
|
||||||
content = content.sub(/\A# .*coding[=:].*$/, '').lstrip
|
content = content.sub(/\A# .*coding[=:].*$/, '').lstrip
|
||||||
|
|
||||||
# strip leading '#'s, but only if all lines start with them
|
# strip leading '#'s, but only if all lines start with them
|
||||||
|
|
|
@ -366,7 +366,7 @@ Usage: #{opt.program_name} [options] [names...]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if ignored and not quiet then
|
unless ignored.empty? or quiet then
|
||||||
$stderr.puts "invalid options: #{ignored.join ', '}"
|
$stderr.puts "invalid options: #{ignored.join ', '}"
|
||||||
$stderr.puts '(invalid options are ignored)'
|
$stderr.puts '(invalid options are ignored)'
|
||||||
end
|
end
|
||||||
|
|
|
@ -670,7 +670,7 @@ class RDoc::Parser::C < RDoc::Parser
|
||||||
@options.title = param
|
@options.title = param
|
||||||
''
|
''
|
||||||
else
|
else
|
||||||
warn "Unrecognized directive :#{directive}:"
|
context.metadata[directive] = param
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -404,7 +404,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
|
||||||
@options.title = param
|
@options.title = param
|
||||||
''
|
''
|
||||||
else
|
else
|
||||||
warn "Unrecognized directive :#{directive}:"
|
@top_level.metadata[directive] = param
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,6 +7,8 @@ class RDoc::Parser::Simple < RDoc::Parser
|
||||||
|
|
||||||
parse_files_matching(//)
|
parse_files_matching(//)
|
||||||
|
|
||||||
|
attr_reader :content # :nodoc:
|
||||||
|
|
||||||
##
|
##
|
||||||
# Prepare to parse a plain file
|
# 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 = RDoc::Markup::PreProcess.new @file_name, @options.rdoc_include
|
||||||
|
|
||||||
preprocess.handle @content do |directive, param|
|
preprocess.handle @content do |directive, param|
|
||||||
warn "Unrecognized directive '#{directive}' in #{@file_name}"
|
top_level.metadata[directive] = param
|
||||||
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,18 @@ class TestRDocCodeObject < XrefTestCase
|
||||||
assert @co.documented?
|
assert @co.documented?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_metadata
|
||||||
|
assert_empty @co.metadata
|
||||||
|
|
||||||
|
@co.metadata['markup'] = 'not_rdoc'
|
||||||
|
|
||||||
|
expected = { 'markup' => 'not_rdoc' }
|
||||||
|
|
||||||
|
assert_equal expected, @co.metadata
|
||||||
|
|
||||||
|
assert_equal 'not_rdoc', @co.metadata['markup']
|
||||||
|
end
|
||||||
|
|
||||||
def test_parent_file_name
|
def test_parent_file_name
|
||||||
assert_equal '(unknown)', @co.parent_file_name
|
assert_equal '(unknown)', @co.parent_file_name
|
||||||
assert_equal 'xref_data.rb', @c1.parent_file_name
|
assert_equal 'xref_data.rb', @c1.parent_file_name
|
||||||
|
|
|
@ -39,5 +39,16 @@ class TestRDocOptions < MiniTest::Unit::TestCase
|
||||||
assert_match %r%^invalid option: --bogus%, err
|
assert_match %r%^invalid option: --bogus%, err
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_parse_main
|
||||||
|
out, err = capture_io do
|
||||||
|
@options.parse %w[--main MAIN]
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_empty out
|
||||||
|
assert_empty err
|
||||||
|
|
||||||
|
assert_equal 'MAIN', @options.main_page
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -406,6 +406,17 @@ Init_Foo(void) {
|
||||||
assert_equal "a comment for bar", bar.comment
|
assert_equal "a comment for bar", bar.comment
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_look_for_directives_in
|
||||||
|
parser = util_parser ''
|
||||||
|
|
||||||
|
comment = "# :markup: not_rdoc\n"
|
||||||
|
|
||||||
|
parser.look_for_directives_in @top_level, comment
|
||||||
|
|
||||||
|
assert_equal "# :markup: not_rdoc\n", comment
|
||||||
|
assert_equal 'not_rdoc', @top_level.metadata['markup']
|
||||||
|
end
|
||||||
|
|
||||||
def test_define_method
|
def test_define_method
|
||||||
content = <<-EOF
|
content = <<-EOF
|
||||||
/*Method Comment! */
|
/*Method Comment! */
|
||||||
|
|
|
@ -151,11 +151,14 @@ class TestRDocParserRuby < MiniTest::Unit::TestCase
|
||||||
def test_look_for_directives_in_unhandled
|
def test_look_for_directives_in_unhandled
|
||||||
util_parser ""
|
util_parser ""
|
||||||
|
|
||||||
comment = "# :unhandled: \n# :title: hi\n"
|
comment = "# :unhandled: \n# :markup: not rdoc\n# :title: hi\n"
|
||||||
|
|
||||||
@parser.look_for_directives_in @top_level, comment
|
@parser.look_for_directives_in @top_level, comment
|
||||||
|
|
||||||
assert_equal "# :unhandled: \n", comment
|
assert_equal "# :unhandled: \n# :markup: not rdoc\n", comment
|
||||||
|
|
||||||
|
assert_equal nil, @top_level.metadata['unhandled']
|
||||||
|
assert_equal 'not rdoc', @top_level.metadata['markup']
|
||||||
|
|
||||||
assert_equal 'hi', @options.title
|
assert_equal 'hi', @options.title
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,6 +22,15 @@ class TestRDocParserSimple < MiniTest::Unit::TestCase
|
||||||
@tempfile.close
|
@tempfile.close
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_initialize_metadata
|
||||||
|
parser = util_parser ":unhandled: \n# :markup: not rdoc\n"
|
||||||
|
|
||||||
|
assert_equal nil, @top_level.metadata['unhandled']
|
||||||
|
assert_equal 'not rdoc', @top_level.metadata['markup']
|
||||||
|
|
||||||
|
assert_equal ":unhandled: \n# :markup: not rdoc\n", parser.content
|
||||||
|
end
|
||||||
|
|
||||||
def test_remove_coding_comment
|
def test_remove_coding_comment
|
||||||
parser = util_parser <<-TEXT
|
parser = util_parser <<-TEXT
|
||||||
# -*- mode: rdoc; coding: utf-8; fill-column: 74; -*-
|
# -*- mode: rdoc; coding: utf-8; fill-column: 74; -*-
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue