Actions
Defect #39576
closed`rake yard` does not work with Ruby >= 3.2
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
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
Related issues
Updated by Go MAEDA 12 months ago
- 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',
Updated by Go MAEDA 12 months ago
- Related to Feature #38099: Add Ruby 3.2 support added
Actions