Skip to content

Commit 20fa463

Browse files
authored
Remove unused method RDoc::Require#top_level that always raises NoMethodError (#1813)
It has been broken since 2d88424 (Move global parse state to RDoc::Store) removed TopLevel.all_files_hash and TopLevel.all_files. Result of `RDoc::Require.new('a','b').top_level` is basically unchanged. Before: `NoMethodError(undefined method 'all_files_hash')` After: `NoMethodError(undefined method 'top_level')`
1 parent 756af19 commit 20fa463

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

‎lib/rdoc/code_object/require.rb‎

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ class Require < CodeObject
1515

1616
def initialize(name, comment)
1717
super()
18-
@name = name.gsub(/'|"/, "") #'
19-
@top_level = nil
18+
@name = name.gsub(/'|"/, "")
2019
self.comment = comment
2120
end
2221

@@ -32,22 +31,5 @@ def inspect # :nodoc:
3231
def to_s # :nodoc:
3332
"require #{name} in: #{parent}"
3433
end
35-
36-
##
37-
# The RDoc::TopLevel corresponding to this require, or +nil+ if not found.
38-
39-
def top_level
40-
@top_level ||= begin
41-
tl = TopLevel.all_files_hash[name + '.rb']
42-
43-
if tl.nil? and TopLevel.all_files.first.full_name =~ %r(^lib/)
44-
# second chance
45-
tl = TopLevel.all_files_hash['lib/' + name + '.rb']
46-
end
47-
48-
tl
49-
end
50-
end
51-
5234
end
5335
end

0 commit comments

Comments
 (0)