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 a27bb8e
Show file tree
Hide file tree
Showing 2 changed files with 9 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
10 changes: 9 additions & 1 deletion lib/rake/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a27bb8e

Please sign in to comment.