Skip to content

Commit

Permalink
cleanup: Remove webcvs option and cvs-related code
Browse files Browse the repository at this point in the history
`webcvs` option is used for `cvs_url` method only, but `cvs_url`
method seems NOT be used anywhere.
  • Loading branch information
okuramasafumi committed Jun 22, 2024
1 parent ccaacd1 commit 6de5b43
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 62 deletions.
32 changes: 0 additions & 32 deletions lib/rdoc/generator/markup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,6 @@ def formatter
@formatter.code_object = self
@formatter
end

##
# Build a webcvs URL starting for the given +url+ with +full_path+ appended
# as the destination path. If +url+ contains '%s' +full_path+ will be
# will replace the %s using sprintf on the +url+.

def cvs_url(url, full_path)
if /%s/ =~ url then
sprintf url, full_path
else
url + full_path
end
end

end

class RDoc::CodeObject
Expand Down Expand Up @@ -139,21 +125,3 @@ class RDoc::Context::Section
include RDoc::Generator::Markup

end

class RDoc::TopLevel

##
# Returns a URL for this source file on some web repository. Use the -W
# command line option to set.

def cvs_url
url = @store.rdoc.options.webcvs

if /%s/ =~ url then
url % @relative_name
else
url + @relative_name
end
end

end
22 changes: 1 addition & 21 deletions lib/rdoc/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,6 @@ class RDoc::Options

attr_accessor :verbosity

##
# URL of web cvs frontend

attr_accessor :webcvs

##
# Minimum visibility of a documented method. One of +:public+, +:protected+,
# +:private+ or +:nodoc+.
Expand Down Expand Up @@ -387,7 +382,6 @@ def init_ivars # :nodoc:
@update_output_dir = true
@verbosity = 1
@visibility = :protected
@webcvs = nil
@write_options = false
@encoding = Encoding::UTF_8
@charset = @encoding.name
Expand Down Expand Up @@ -415,7 +409,6 @@ def init_with map # :nodoc:
@template_dir = map['template_dir']
@title = map['title']
@visibility = map['visibility']
@webcvs = map['webcvs']

@rdoc_include = sanitize_path map['rdoc_include']
@static_path = sanitize_path map['static_path']
Expand Down Expand Up @@ -447,7 +440,6 @@ def override map # :nodoc:
@template_dir = map['template_dir'] if map.has_key?('template_dir')
@title = map['title'] if map.has_key?('title')
@visibility = map['visibility'] if map.has_key?('visibility')
@webcvs = map['webcvs'] if map.has_key?('webcvs')

if map.has_key?('rdoc_include')
@rdoc_include = sanitize_path map['rdoc_include']
Expand All @@ -474,8 +466,7 @@ def == other # :nodoc:
@tab_width == other.tab_width and
@template == other.template and
@title == other.title and
@visibility == other.visibility and
@webcvs == other.webcvs
@visibility == other.visibility
end

##
Expand Down Expand Up @@ -1017,17 +1008,6 @@ def parse argv
@static_path << value
end

opt.separator nil

opt.on("--webcvs=URL", "-W",
"Specify a URL for linking to a web frontend",
"to CVS. If the URL contains a '\%s', the",
"name of the current file will be",
"substituted; if the URL doesn't contain a",
"'\%s', the filename will be appended to it.") do |value|
@webcvs = value
end

opt.separator nil
opt.separator "ri generator options:"
opt.separator nil
Expand Down
8 changes: 0 additions & 8 deletions test/rdoc/test_rdoc_generator_markup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ def test_as_href
assert_equal '../index.html', as_href('Foo/Bar.html')
end

def test_cvs_url
assert_equal 'http://example/this_page',
cvs_url('http://example/', 'this_page')

assert_equal 'http://example/?page=this_page&foo=bar',
cvs_url('http://example/?page=%s&foo=bar', 'this_page')
end

def test_description
@comment = '= Hello'

Expand Down
1 change: 0 additions & 1 deletion test/rdoc/test_rdoc_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def test_to_yaml
'template_stylesheets' => [],
'title' => nil,
'visibility' => :protected,
'webcvs' => nil,
'skip_tests' => true,
}

Expand Down

0 comments on commit 6de5b43

Please sign in to comment.