Skip to content

Commit 34e71db

Browse files
Replace set usages with arrays
Set has been gemified as of ruby 3.0.0. Since `bundler` vendors `thor` internally, it's helpful for `bundler` that `thor` doesn't use `set`, so that `bundler` doesn't activate the gem `set` too early and final users can still specify whichever version of `set` they want in their Gemfiles.
1 parent 80c6d19 commit 34e71db

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/thor.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
require "set"
21
require_relative "thor/base"
32

43
class Thor
@@ -324,7 +323,7 @@ def check_unknown_options?(config) #:nodoc:
324323
# ==== Parameters
325324
# Symbol ...:: A list of commands that should be affected.
326325
def stop_on_unknown_option!(*command_names)
327-
stop_on_unknown_option.merge(command_names)
326+
@stop_on_unknown_option = stop_on_unknown_option | command_names
328327
end
329328

330329
def stop_on_unknown_option?(command) #:nodoc:
@@ -338,7 +337,7 @@ def stop_on_unknown_option?(command) #:nodoc:
338337
# ==== Parameters
339338
# Symbol ...:: A list of commands that should be affected.
340339
def disable_required_check!(*command_names)
341-
disable_required_check.merge(command_names)
340+
@disable_required_check = disable_required_check | command_names
342341
end
343342

344343
def disable_required_check?(command) #:nodoc:
@@ -348,12 +347,12 @@ def disable_required_check?(command) #:nodoc:
348347
protected
349348

350349
def stop_on_unknown_option #:nodoc:
351-
@stop_on_unknown_option ||= Set.new
350+
@stop_on_unknown_option ||= []
352351
end
353352

354353
# help command has the required check disabled by default.
355354
def disable_required_check #:nodoc:
356-
@disable_required_check ||= Set.new([:help])
355+
@disable_required_check ||= [:help]
357356
end
358357

359358
# The method responsible for dispatching given the args.

0 commit comments

Comments
 (0)