Skip to content

Commit 3feff8c

Browse files
committed
Remove unused prefix argument from http_url methods
Since their prefix argument is always nil, we can stop passing it and simplify the methods accordingly.
1 parent d1ba4ca commit 3feff8c

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

lib/rdoc/code_object/class_module.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ def parse comment_location
634634
# Path to this class or module for use with HTML generator output.
635635

636636
def path
637-
http_url(nil)
637+
http_url
638638
end
639639

640640
##

lib/rdoc/code_object/context.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -973,10 +973,10 @@ def fully_documented?
973973
##
974974
# URL for this with a +prefix+
975975

976-
def http_url(prefix)
976+
def http_url
977977
path = name_for_path
978978
path = path.gsub(/<<\s*(\w*)/, 'from-\1') if path =~ /<</
979-
path = [prefix] + path.split('::')
979+
path = path.split('::')
980980

981981
File.join(*path.compact) + '.html'
982982
end

lib/rdoc/code_object/top_level.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,8 @@ def hash
173173
##
174174
# URL for this with a +prefix+
175175

176-
def http_url(prefix)
177-
path = [prefix, @relative_name.tr('.', '_')]
178-
179-
File.join(*path.compact) + '.html'
176+
def http_url
177+
@relative_name.tr('.', '_') + '.html'
180178
end
181179

182180
def inspect # :nodoc:
@@ -246,7 +244,7 @@ def page_name
246244
# Path to this file for use with HTML generator output.
247245

248246
def path
249-
http_url(nil)
247+
http_url
250248
end
251249

252250
def pretty_print q # :nodoc:

test/rdoc/test_rdoc_top_level.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ def test_hash
156156
end
157157

158158
def test_http_url
159-
assert_equal 'prefix/path/top_level_rb.html', @top_level.http_url('prefix')
159+
assert_equal 'path/top_level_rb.html', @top_level.http_url
160160

161161
other_level = @store.add_file 'path.other/level.rb'
162-
assert_equal 'prefix/path_other/level_rb.html', other_level.http_url('prefix')
162+
assert_equal 'path_other/level_rb.html', other_level.http_url
163163
end
164164

165165
def test_last_modified

0 commit comments

Comments
 (0)