From a27bb8e10786efa4776cc3ecfe12490e1ea106a7 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 14 Mar 2024 18:07:57 +0900 Subject: [PATCH] Use Struct instead of OpenStruct. I will migrate osturct as bundled gems at Ruby 3.5. We should remove its dependency from Rake --- lib/rake.rb | 1 - lib/rake/application.rb | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/rake.rb b/lib/rake.rb index 0dfd05315..0f3d6a330 100644 --- a/lib/rake.rb +++ b/lib/rake.rb @@ -30,7 +30,6 @@ module Rake; end require "singleton" require "monitor" require "optparse" -require "ostruct" require "rake/ext/string" diff --git a/lib/rake/application.rb b/lib/rake/application.rb index ac5714b11..143c96f03 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -165,7 +165,15 @@ def add_loader(ext, loader) # Application options from the command line def options - @options ||= OpenStruct.new + return @options if @options + + @options = Struct.new( + :always_multitask, :backtrace, :build_all, :dryrun, + :ignore_deprecate, :ignore_system, :job_stats, :load_system, + :nosearch, :rakelib, :show_all_tasks, :show_prereqs, + :show_task_pattern, :show_tasks, :silent, :suppress_backtrace_pattern, + :thread_pool_size, :trace, :trace_output, :trace_rules + ).new end # Return the thread pool used for multithreaded processing.