Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌈 Replace set usages with arrays #746

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/thor.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "set"
require_relative "thor/base"

class Thor
Expand Down Expand Up @@ -324,7 +323,7 @@ def check_unknown_options?(config) #:nodoc:
# ==== Parameters
# Symbol ...:: A list of commands that should be affected.
def stop_on_unknown_option!(*command_names)
stop_on_unknown_option.merge(command_names)
@stop_on_unknown_option = stop_on_unknown_option | command_names
end

def stop_on_unknown_option?(command) #:nodoc:
Expand All @@ -338,7 +337,7 @@ def stop_on_unknown_option?(command) #:nodoc:
# ==== Parameters
# Symbol ...:: A list of commands that should be affected.
def disable_required_check!(*command_names)
disable_required_check.merge(command_names)
@disable_required_check = disable_required_check | command_names
end

def disable_required_check?(command) #:nodoc:
Expand All @@ -348,12 +347,12 @@ def disable_required_check?(command) #:nodoc:
protected

def stop_on_unknown_option #:nodoc:
@stop_on_unknown_option ||= Set.new
@stop_on_unknown_option ||= []
end

# help command has the required check disabled by default.
def disable_required_check #:nodoc:
@disable_required_check ||= Set.new([:help])
@disable_required_check ||= [:help]
end

# The method responsible for dispatching given the args.
Expand Down