mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rdoc/top_level.rb: Fixed extension trimming for page names in
RDoc HTML output. [ruby-trunk - Bug #7673] * test/rdoc/test_rdoc_top_level.rb: Test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9deb82b1d9
commit
c8633294c6
3 changed files with 22 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Tue Jan 15 07:39:21 2013 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* lib/rdoc/top_level.rb: Fixed extension trimming for page names in
|
||||
RDoc HTML output. [ruby-trunk - Bug #7673]
|
||||
* test/rdoc/test_rdoc_top_level.rb: Test for above.
|
||||
|
||||
Mon Jan 14 23:06:41 2013 Keiju Ishitsuka <keiju@ishitsuka.com>
|
||||
|
||||
* lib/irb/ext/save-history.rb: outputs its history to
|
||||
|
|
|
@ -226,7 +226,7 @@ class RDoc::TopLevel < RDoc::Context
|
|||
|
||||
def page_name
|
||||
basename = File.basename @relative_name
|
||||
basename =~ /\.[^.]*$/
|
||||
basename =~ /\.(rb|rdoc|txt|md)$/i
|
||||
|
||||
$` || basename
|
||||
end
|
||||
|
|
|
@ -214,7 +214,7 @@ class TestRDocTopLevel < XrefTestCase
|
|||
def test_page_name
|
||||
assert_equal 'top_level', @top_level.page_name
|
||||
|
||||
tl = @store.add_file 'README.ja.rdoc'
|
||||
tl = @store.add_file 'README.ja'
|
||||
|
||||
assert_equal 'README.ja', tl.page_name
|
||||
|
||||
|
@ -223,6 +223,20 @@ class TestRDocTopLevel < XrefTestCase
|
|||
assert_equal 'Rakefile', tl.page_name
|
||||
end
|
||||
|
||||
def test_page_name_trim_extension
|
||||
tl = @store.add_file 'README.ja.rdoc'
|
||||
|
||||
assert_equal 'README.ja', tl.page_name
|
||||
|
||||
tl = @store.add_file 'README.ja.md'
|
||||
|
||||
assert_equal 'README.ja', tl.page_name
|
||||
|
||||
tl = @store.add_file 'README.txt'
|
||||
|
||||
assert_equal 'README', tl.page_name
|
||||
end
|
||||
|
||||
def test_search_record
|
||||
assert_nil @xref_data.search_record
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue