[ruby/rdoc] Drop unnecessary file_name parameter from Parser.for

method.
(https://github.com/ruby/rdoc/pull/1135)

* Unify top_level creation in tests

* Remove unnecessary file_name param from Parser.for

It should be always the same as the top_level's absolute_name, so there's
no point of taking it as a separate parameter.

97c497dfbb
This commit is contained in:
Stan Lo 2024-07-31 15:36:37 +01:00 committed by git
parent 12a5400a88
commit 27c22f822a
3 changed files with 38 additions and 40 deletions

View file

@ -166,7 +166,8 @@ class RDoc::Parser
# Finds and instantiates the correct parser for the given +file_name+ and
# +content+.
def self.for top_level, file_name, content, options, stats
def self.for top_level, content, options, stats
file_name = top_level.absolute_name
return if binary? file_name
parser = use_markup content