Skip to content

Commit

Permalink
There is no super method to check
Browse files Browse the repository at this point in the history
Thor will not inherit from any other class, and the goal is to allow
subclasses to override the sort_commands! method, so we don't need to
check for super.
  • Loading branch information
rafaelfranca committed May 11, 2023
1 parent 60abf76 commit a562cdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/thor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def help(command = nil, subcommand = true); super; end
# Can be overridden in the subclass to change the display order of the
# commands.
def sort_commands!(list)
defined?(super) ? super(list) : list.sort! { |a, b| a[0] <=> b[0] }
list.sort! { |a, b| a[0] <=> b[0] }
end
end

Expand Down

0 comments on commit a562cdc

Please sign in to comment.