Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions lib/rdoc/code_object/require.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class Require < CodeObject

def initialize(name, comment)
super()
@name = name.gsub(/'|"/, "") #'
@top_level = nil
@name = name.gsub(/'|"/, "")
self.comment = comment
end

Expand All @@ -32,22 +31,5 @@ def inspect # :nodoc:
def to_s # :nodoc:
"require #{name} in: #{parent}"
end

##
# The RDoc::TopLevel corresponding to this require, or +nil+ if not found.

def top_level
@top_level ||= begin
tl = TopLevel.all_files_hash[name + '.rb']

if tl.nil? and TopLevel.all_files.first.full_name =~ %r(^lib/)
# second chance
tl = TopLevel.all_files_hash['lib/' + name + '.rb']
end

tl
end
end

end
end