Skip to content

Commit

Permalink
Use Struct instead of OpenStruct.
Browse files Browse the repository at this point in the history
I will migrate osturct as bundled gems at Ruby 3.5. We should remove
its dependency from Rake
  • Loading branch information
hsbt committed Mar 14, 2024
1 parent 15e936c commit dcb5c1c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/rake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ module Rake; end
require "singleton"
require "monitor"
require "optparse"
require "ostruct"

require "rake/ext/string"

Expand Down
17 changes: 16 additions & 1 deletion lib/rake/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,22 @@ def add_loader(ext, loader)

# Application options from the command line
def options
@options ||= OpenStruct.new
return @options if @options

option = 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
)
@options = option.new(
false, false, false, false,
false, false, false, false,
false, %w[rakelib], false, false,
nil, nil, false, nil,
Rake.suggested_thread_count, false, $stderr, false
)
end

# Return the thread pool used for multithreaded processing.
Expand Down

0 comments on commit dcb5c1c

Please sign in to comment.