Defect #39576
closed
`rake yard` does not work with Ruby >= 3.2
Added by Go MAEDA about 1 year ago.
Updated about 1 year ago.
Description
`rake yard` which generates YARD documentation raises an exception and exits immediately after startup if the Ruby version is 3.2 or higher.
Please see error.txt.
Files
- Subject changed from `rake yard` does not work with Ruby > 3.2 to `rake yard` does not work with Ruby >= 3.2
- Target version set to 5.1.1
The following change fixes the issue.
The cause of this issue is that the current code creates a nested array by adding another array as a single element using the <<
operator. The variable t.files
expects a flat array, but the current implementation results in a nested array like ['app/**/*..rb', ["lib/generators/redmine_plugin/redmine_plugin_generator.rb", ...]]
.
Replacing <<
with +=
creates a flat array, aligning with the expected structure for t.files
.
Index: lib/tasks/yardoc.rake
===================================================================
--- lib/tasks/yardoc.rake (リビジョン 22450)
+++ lib/tasks/yardoc.rake (作業コピー)
@@ -3,7 +3,7 @@
YARD::Rake::YardocTask.new do |t|
files = ['app/**/*.rb']
- files << Dir['lib/**/*.rb', 'plugins/**/*.rb'].reject {|f| f.match(/test/) }
+ files += Dir['lib/**/*.rb', 'plugins/**/*.rb'].reject {|f| f.match(/test/)}
t.files = files
static_files = ['doc/CHANGELOG',
- Status changed from New to Resolved
- Assignee set to Go MAEDA
Committed the patch in r22456.
- Status changed from Resolved to Closed
- Resolution set to Fixed
Also available in: Atom
PDF