Skip to content

Commit 80dbb2a

Browse files
authored
Add Darkfish deprecation warning (#1797)
I want to remove Darkfish completely in the next major release, so let's start showing deprecation warnings for it. - Aliki shouldn't show the deprecation message - Other generators thats' built on top of Darkfish should see it, such as [rorvswild](https://github.com/BaseSecrete/rorvswild-theme-rdoc) We can't cover all the cases where Darkfish is used, so this is just a best effort notification. Readme has been announcing this removal for a while.
1 parent 268350e commit 80dbb2a

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

‎lib/rdoc/generator/darkfish.rb‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ def write_style_sheet
214214
# objects containing the extracted information.
215215

216216
def generate
217+
warn "The Darkfish template is deprecated and will be removed in version 9.0."
218+
217219
setup
218220

219221
write_style_sheet

‎test/rdoc/generator/aliki_test.rb‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ def teardown
5959
FileUtils.rm_rf @tmpdir
6060
end
6161

62+
def test_generate_does_not_warn_about_darkfish_deprecation
63+
_, err = capture_output do
64+
@g.generate
65+
end
66+
67+
assert_empty err
68+
end
69+
6270
def test_inheritance_and_template_dir
6371
assert_kind_of RDoc::Generator::Darkfish, @g
6472
assert_match %r{/template/aliki\z}, @g.template_dir.to_s

‎test/rdoc/generator/darkfish_test.rb‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,25 @@ def teardown
6969
FileUtils.rm_rf @tmpdir
7070
end
7171

72+
def test_generate_warns_about_deprecation
73+
_, err = capture_output do
74+
@g.generate
75+
end
76+
77+
assert_equal "The Darkfish template is deprecated and will be removed in version 9.0.\n", err
78+
end
79+
80+
def test_generate_warns_about_deprecation_for_subclass
81+
generator = Class.new(RDoc::Generator::Darkfish).new @store, @options
82+
@rdoc.generator = generator
83+
84+
_, err = capture_output do
85+
generator.generate
86+
end
87+
88+
assert_equal "The Darkfish template is deprecated and will be removed in version 9.0.\n", err
89+
end
90+
7291
def test_generate
7392
top_level = @store.add_file 'file.rb'
7493
top_level.add_class @klass.class, @klass.name

0 commit comments

Comments
 (0)