зеркало из https://github.com/github/ruby.git
[ruby/rdoc] Support full filename to make a link for a text file
https://github.com/ruby/rdoc/commit/41db49c485
This commit is contained in:
Родитель
3b159374a2
Коммит
b5db9b8a31
|
@ -173,7 +173,7 @@ class RDoc::CrossReference
|
|||
end unless ref
|
||||
|
||||
# Try a page name
|
||||
ref = @store.page name if not ref and name =~ /^\w+$/
|
||||
ref = @store.page name if not ref and name =~ /^[\w.]+$/
|
||||
|
||||
ref = nil if RDoc::Alias === ref # external alias, can't link to it
|
||||
|
||||
|
|
|
@ -723,7 +723,7 @@ class RDoc::Store
|
|||
|
||||
def page name
|
||||
@text_files_hash.each_value.find do |file|
|
||||
file.page_name == name
|
||||
file.page_name == name or file.base_name == name
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -611,6 +611,14 @@ class TestRDocStore < XrefTestCase
|
|||
assert_equal page, @store.page('PAGE')
|
||||
end
|
||||
|
||||
def test_page_with_extension
|
||||
page = @store.add_file 'PAGE.txt', parser: RDoc::Parser::Simple
|
||||
|
||||
assert_nil @store.page 'no such page'
|
||||
|
||||
assert_equal page, @store.page('PAGE.txt')
|
||||
end
|
||||
|
||||
def test_save
|
||||
FileUtils.mkdir_p @tmpdir
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче