From 19eec2a2a7912067047f2bbf60a7867915e1a443 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Sat, 29 Aug 2026 18:03:20 +0100 Subject: [PATCH 1/2] Add Darkfish deprecation warning Assisted-By: devx/0d67a386-6fea-4c9d-96ef-064c1cc8810c --- lib/rdoc/generator/darkfish.rb | 4 ++++ test/rdoc/generator/aliki_test.rb | 8 ++++++++ test/rdoc/generator/darkfish_test.rb | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb index 1919b9aa0f..979509a71f 100644 --- a/lib/rdoc/generator/darkfish.rb +++ b/lib/rdoc/generator/darkfish.rb @@ -214,6 +214,10 @@ def write_style_sheet # objects containing the extracted information. def generate + if self.class == Generator::Darkfish + warn "The Darkfish template is deprecated and will be removed in version 9.0." + end + setup write_style_sheet diff --git a/test/rdoc/generator/aliki_test.rb b/test/rdoc/generator/aliki_test.rb index 00054a5a90..f38f27d1dd 100644 --- a/test/rdoc/generator/aliki_test.rb +++ b/test/rdoc/generator/aliki_test.rb @@ -59,6 +59,14 @@ def teardown FileUtils.rm_rf @tmpdir end + def test_generate_does_not_warn_about_darkfish_deprecation + _, err = capture_output do + @g.generate + end + + assert_empty err + end + def test_inheritance_and_template_dir assert_kind_of RDoc::Generator::Darkfish, @g assert_match %r{/template/aliki\z}, @g.template_dir.to_s diff --git a/test/rdoc/generator/darkfish_test.rb b/test/rdoc/generator/darkfish_test.rb index 966a8f2d2e..9dbc64042c 100644 --- a/test/rdoc/generator/darkfish_test.rb +++ b/test/rdoc/generator/darkfish_test.rb @@ -69,6 +69,14 @@ def teardown FileUtils.rm_rf @tmpdir end + def test_generate_warns_about_deprecation + _, err = capture_output do + @g.generate + end + + assert_equal "The Darkfish template is deprecated and will be removed in version 9.0.\n", err + end + def test_generate top_level = @store.add_file 'file.rb' top_level.add_class @klass.class, @klass.name From 5b733bfad6555d5cb4ad52c1a1d6f29e6ed1932d Mon Sep 17 00:00:00 2001 From: st0012 Date: Sun, 13 Sep 2026 10:37:16 +0100 Subject: [PATCH 2/2] Warn when Darkfish subclasses generate documentation --- lib/rdoc/generator/darkfish.rb | 4 +--- test/rdoc/generator/darkfish_test.rb | 11 +++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb index 979509a71f..c097bab70c 100644 --- a/lib/rdoc/generator/darkfish.rb +++ b/lib/rdoc/generator/darkfish.rb @@ -214,9 +214,7 @@ def write_style_sheet # objects containing the extracted information. def generate - if self.class == Generator::Darkfish - warn "The Darkfish template is deprecated and will be removed in version 9.0." - end + warn "The Darkfish template is deprecated and will be removed in version 9.0." setup diff --git a/test/rdoc/generator/darkfish_test.rb b/test/rdoc/generator/darkfish_test.rb index 9dbc64042c..d853101312 100644 --- a/test/rdoc/generator/darkfish_test.rb +++ b/test/rdoc/generator/darkfish_test.rb @@ -77,6 +77,17 @@ def test_generate_warns_about_deprecation assert_equal "The Darkfish template is deprecated and will be removed in version 9.0.\n", err end + def test_generate_warns_about_deprecation_for_subclass + generator = Class.new(RDoc::Generator::Darkfish).new @store, @options + @rdoc.generator = generator + + _, err = capture_output do + generator.generate + end + + assert_equal "The Darkfish template is deprecated and will be removed in version 9.0.\n", err + end + def test_generate top_level = @store.add_file 'file.rb' top_level.add_class @klass.class, @klass.name