Skip to content

Commit dcb5c1c

Browse files
committed
Use Struct instead of OpenStruct.
I will migrate osturct as bundled gems at Ruby 3.5. We should remove its dependency from Rake
1 parent 15e936c commit dcb5c1c

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

lib/rake.rb

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ module Rake; end
3030
require "singleton"
3131
require "monitor"
3232
require "optparse"
33-
require "ostruct"
3433

3534
require "rake/ext/string"
3635

lib/rake/application.rb

+16-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,22 @@ def add_loader(ext, loader)
165165

166166
# Application options from the command line
167167
def options
168-
@options ||= OpenStruct.new
168+
return @options if @options
169+
170+
option = Struct.new(
171+
:always_multitask, :backtrace, :build_all, :dryrun,
172+
:ignore_deprecate, :ignore_system, :job_stats, :load_system,
173+
:nosearch, :rakelib, :show_all_tasks, :show_prereqs,
174+
:show_task_pattern, :show_tasks, :silent, :suppress_backtrace_pattern,
175+
:thread_pool_size, :trace, :trace_output, :trace_rules
176+
)
177+
@options = option.new(
178+
false, false, false, false,
179+
false, false, false, false,
180+
false, %w[rakelib], false, false,
181+
nil, nil, false, nil,
182+
Rake.suggested_thread_count, false, $stderr, false
183+
)
169184
end
170185

171186
# Return the thread pool used for multithreaded processing.

0 commit comments

Comments
 (0)