Skip to content

Commit 3bb10a6

Browse files
committed
Remove deprecated CLI options and inline_source
Remove the DEPRECATED options hash (--accessor, --diagram, --inline-source, etc.), the -d/--diagram special option block, the deprecated-option rescue/retry/warning logic, the deprecated options section in --help output, stylesheet_url from the SPECIAL array, and the RDoc::Task#inline_source accessors. These have been deprecated since RDoc 4+ and users have had ample notice.
1 parent 78ca6f5 commit 3bb10a6

4 files changed

Lines changed: 1 addition & 93 deletions

File tree

lib/rdoc/options.rb

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,6 @@
7474

7575
class RDoc::Options
7676

77-
##
78-
# The deprecated options.
79-
80-
DEPRECATED = {
81-
'--accessor' => 'support discontinued',
82-
'--diagram' => 'support discontinued',
83-
'--help-output' => 'support discontinued',
84-
'--image-format' => 'was an option for --diagram',
85-
'--inline-source' => 'source code is now always inlined',
86-
'--merge' => 'ri now always merges class information',
87-
'--one-file' => 'support discontinued',
88-
'--op-name' => 'support discontinued',
89-
'--opname' => 'support discontinued',
90-
'--promiscuous' => 'files always only document their content',
91-
'--ri-system' => 'Ruby installers use other techniques',
92-
}
93-
9477
##
9578
# RDoc options ignored (or handled specially) by --write-options
9679

@@ -113,7 +96,6 @@ class RDoc::Options
11396
rdoc_include
11497
root
11598
static_path
116-
stylesheet_url
11799
template
118100
template_dir
119101
update_output_dir
@@ -430,7 +412,6 @@ def init_ivars # :nodoc:
430412
@root = Pathname(Dir.pwd)
431413
@show_hash = false
432414
@static_path = []
433-
@stylesheet_url = nil # TODO remove in RDoc 4
434415
@tab_width = 8
435416
@template = nil
436417
@template_dir = nil
@@ -769,14 +750,6 @@ def parse(argv)
769750
end
770751
opt.banner += " - TomDoc: Only in ruby files\n"
771752

772-
opt.banner += "\n The following options are deprecated:\n\n"
773-
774-
name_length = DEPRECATED.keys.sort_by { |k| k.length }.last.length
775-
776-
DEPRECATED.sort_by { |k,| k }.each do |name, reason|
777-
opt.banner += " %*1$2$s %3$s\n" % [-name_length, name, reason]
778-
end
779-
780753
opt.accept Template do |template|
781754
template_dir = template_dir_for template
782755

@@ -1013,14 +986,6 @@ def parse(argv)
1013986
@op_dir = value
1014987
end
1015988

1016-
opt.separator nil
1017-
1018-
opt.on("-d",
1019-
"Deprecated --diagram option.",
1020-
"Prevents firing debug mode",
1021-
"with legacy invocation.") do |value|
1022-
end
1023-
1024989
opt.separator nil
1025990
opt.separator 'HTML generator options:'
1026991
opt.separator nil
@@ -1230,15 +1195,12 @@ def parse(argv)
12301195
opt.separator nil
12311196
end
12321197

1233-
deprecated = []
12341198
invalid = []
12351199

12361200
begin
12371201
opts.parse! argv
12381202
rescue OptionParser::ParseError => e
1239-
if DEPRECATED[e.args.first] then
1240-
deprecated << e.args.first
1241-
elsif %w[--format --ri -r --ri-site -R].include? e.args.first then
1203+
if %w[--format --ri -r --ri-site -R].include? e.args.first then
12421204
raise
12431205
else
12441206
invalid << e.args.join(' ')
@@ -1254,12 +1216,6 @@ def parse(argv)
12541216
invalid << '-p (with files)'
12551217
end
12561218

1257-
unless quiet then
1258-
deprecated.each do |opt|
1259-
$stderr.puts 'option ' + opt + ' is deprecated: ' + DEPRECATED[opt]
1260-
end
1261-
end
1262-
12631219
unless invalid.empty? then
12641220
invalid = "invalid options: #{invalid.join ', '}"
12651221

lib/rdoc/task.rb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -202,21 +202,6 @@ def defaults
202202
@options = []
203203
end
204204

205-
##
206-
# All source is inline now. This method is deprecated
207-
208-
def inline_source # :nodoc:
209-
warn "RDoc::Task#inline_source is deprecated"
210-
true
211-
end
212-
213-
##
214-
# All source is inline now. This method is deprecated
215-
216-
def inline_source=(value) # :nodoc:
217-
warn "RDoc::Task#inline_source is deprecated"
218-
end
219-
220205
##
221206
# Create the tasks defined by this task lib.
222207

test/rdoc/rdoc_options_test.rb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -281,21 +281,6 @@ def test_parse_default
281281
assert_match %r%rdoc/generator/template/aliki$%, @options.template_dir
282282
end
283283

284-
def test_parse_deprecated
285-
dep_hash = RDoc::Options::DEPRECATED
286-
options = dep_hash.keys.sort
287-
288-
out, err = capture_output do
289-
@options.parse options
290-
end
291-
292-
dep_hash.each_pair do |opt, message|
293-
assert_match %r%.*#{opt}.+#{message}%, err
294-
end
295-
296-
assert_empty out
297-
end
298-
299284
def test_parse_dry_run
300285
@options.parse %w[--dry-run]
301286

test/rdoc/rdoc_task_test.rb

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,6 @@ def test_clobber_task_description
1919
assert_equal 'Remove RDoc HTML files', @t.clobber_task_description
2020
end
2121

22-
def test_inline_source
23-
_, err = verbose_capture_output do
24-
assert @t.inline_source
25-
end
26-
27-
assert_include err, "RDoc::Task#inline_source is deprecated\n"
28-
29-
_, err = verbose_capture_output do
30-
@t.inline_source = false
31-
end
32-
33-
assert_include err, "RDoc::Task#inline_source is deprecated\n"
34-
35-
capture_output do
36-
assert @t.inline_source
37-
end
38-
end
39-
4022
def test_markup_option
4123
rdoc_task = RDoc::Task.new do |rd|
4224
rd.markup = "tomdoc"

0 commit comments

Comments
 (0)