From 76c7388c1f41fb0ae3dacda0d9c02e7562a6655d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 18 Aug 2021 13:48:12 +0900 Subject: [ruby/rdoc] Add tests for `--template-stylesheets` option Also flattens `@options.template_stylesheets` when parsing the command lines. Fixes #205 Fixes #828 too https://github.com/ruby/rdoc/commit/857002a763 --- lib/rdoc/generator/darkfish.rb | 4 ++-- lib/rdoc/generator/template/darkfish/_head.rhtml | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/rdoc/generator') diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb index b46861d009..60e0265e8c 100644 --- a/lib/rdoc/generator/darkfish.rb +++ b/lib/rdoc/generator/darkfish.rb @@ -220,8 +220,8 @@ class RDoc::Generator::Darkfish install_rdoc_static_file @template_dir + item, "./#{item}", options end - @options.template_stylesheets.each do |stylesheet| - FileUtils.cp stylesheet, '.', options + unless @options.template_stylesheets.empty? + FileUtils.cp @options.template_stylesheets, '.', **options end Dir[(@template_dir + "{js,images}/**/*").to_s].each do |path| diff --git a/lib/rdoc/generator/template/darkfish/_head.rhtml b/lib/rdoc/generator/template/darkfish/_head.rhtml index e61fce1b9a..4f331245c3 100644 --- a/lib/rdoc/generator/template/darkfish/_head.rhtml +++ b/lib/rdoc/generator/template/darkfish/_head.rhtml @@ -15,8 +15,6 @@ -<%- if @options.template_stylesheets.flatten.any? then -%> -<%- @options.template_stylesheets.flatten.each do |stylesheet| -%> +<%- @options.template_stylesheets.each do |stylesheet| -%> -<%- end -%> <%- end -%> -- cgit v1.2.3