diff options
author | Stan Lo <[email protected]> | 2024-07-31 15:36:37 +0100 |
---|---|---|
committer | git <[email protected]> | 2024-07-31 14:36:41 +0000 |
commit | 27c22f822af49e7008b7c9ff75b971d984975e6e (patch) | |
tree | f208457206bef6dfa47dd0ed40f7143e340b9e1e /lib | |
parent | 12a5400a8846ed05284b4360faeae72e49e55f93 (diff) |
[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.
https://github.com/ruby/rdoc/commit/97c497dfbb
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rdoc/parser.rb | 3 | ||||
-rw-r--r-- | lib/rdoc/rdoc.rb | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb index 425105effa..76801ba377 100644 --- a/lib/rdoc/parser.rb +++ b/lib/rdoc/parser.rb @@ -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 diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb index 2da6d9b575..e1b961b124 100644 --- a/lib/rdoc/rdoc.rb +++ b/lib/rdoc/rdoc.rb @@ -356,7 +356,7 @@ option) top_level = @store.add_file filename, relative_name: relative_path.to_s - parser = RDoc::Parser.for top_level, filename, content, @options, @stats + parser = RDoc::Parser.for top_level, content, @options, @stats return unless parser |