diff options
author | aycabta <aycabta@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-17 06:28:20 +0000 |
---|---|---|
committer | aycabta <aycabta@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-17 06:28:20 +0000 |
commit | 1b43644edc85a93bfc9228588c065c87f975cd93 (patch) | |
tree | ef3a60d0cbe73d15b39f6160853df9a23239a574 /lib/rdoc/store.rb | |
parent | 2a59b579fed2fd49973ca73890f182299262909f (diff) |
Merge rdoc-6.1.0.beta2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/store.rb')
-rw-r--r-- | lib/rdoc/store.rb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/rdoc/store.rb b/lib/rdoc/store.rb index b7e677abf9..f420fc2bd2 100644 --- a/lib/rdoc/store.rb +++ b/lib/rdoc/store.rb @@ -148,6 +148,7 @@ class RDoc::Store @classes_hash = {} @modules_hash = {} @files_hash = {} + @text_files_hash = {} @c_enclosure_classes = {} @c_enclosure_names = {} @@ -184,16 +185,24 @@ class RDoc::Store # Adds the file with +name+ as an RDoc::TopLevel to the store. Returns the # created RDoc::TopLevel. - def add_file absolute_name, relative_name = absolute_name + def add_file absolute_name, relative_name: absolute_name, parser: nil unless top_level = @files_hash[relative_name] then top_level = RDoc::TopLevel.new absolute_name, relative_name + top_level.parser = parser if parser top_level.store = self @files_hash[relative_name] = top_level + @text_files_hash[relative_name] = top_level if top_level.text? end top_level end + def update_parser_of_file(absolute_name, parser) + if top_level = @files_hash[absolute_name] then + @text_files_hash[absolute_name] = top_level if top_level.text? + end + end + ## # Returns all classes discovered by RDoc @@ -428,8 +437,8 @@ class RDoc::Store # +file_name+ def find_text_page file_name - @files_hash.each_value.find do |file| - file.text? and file.full_name == file_name + @text_files_hash.each_value.find do |file| + file.full_name == file_name end end @@ -537,6 +546,7 @@ class RDoc::Store @cache[:pages].each do |page_name| page = load_page page_name @files_hash[page_name] = page + @text_files_hash[page_name] = page if page.text? end end @@ -712,8 +722,8 @@ class RDoc::Store # Returns the RDoc::TopLevel that is a text file and has the given +name+ def page name - @files_hash.each_value.find do |file| - file.text? and file.page_name == name + @text_files_hash.each_value.find do |file| + file.page_name == name end end |