File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ class RDoc::TopLevel < RDoc::Context
1616
1717 attr_accessor :absolute_name
1818
19+ ##
20+ # Base name of this file
21+
22+ attr_reader :base_name
23+
1924 ##
2025 # All the classes or modules that were declared in
2126 # this file. These are assigned to either +#classes_hash+
@@ -38,6 +43,7 @@ def initialize(absolute_name, relative_name = absolute_name)
3843 @name = nil
3944 @absolute_name = absolute_name
4045 @relative_name = relative_name
46+ @base_name = File . basename relative_name
4147 @parser = nil
4248
4349 @classes_or_modules = [ ]
@@ -105,13 +111,6 @@ def add_to_classes_or_modules(mod)
105111 @classes_or_modules << mod
106112 end
107113
108- ##
109- # Base name of this file
110-
111- def base_name
112- File . basename @relative_name
113- end
114-
115114 alias name base_name
116115
117116 ##
@@ -208,10 +207,8 @@ def object_class
208207 # Base name of this file without the extension
209208
210209 def page_name
211- basename = File . basename @relative_name
212- basename =~ /\. (rb|rdoc|txt|md)$/i
213-
214- $` || basename
210+ @basename =~ /\. (rb|rdoc|txt|md)$/i
211+ $` || @base_name
215212 end
216213
217214 ##
You can’t perform that action at this time.
0 commit comments