diff --git a/Library/Homebrew/cask/cmd/abstract_command.rb b/Library/Homebrew/cask/cmd/abstract_command.rb index 23e972087c..96cdac5bc9 100644 --- a/Library/Homebrew/cask/cmd/abstract_command.rb +++ b/Library/Homebrew/cask/cmd/abstract_command.rb @@ -1,4 +1,4 @@ -# typed: false +# typed: true # frozen_string_literal: true require "search" @@ -40,12 +40,12 @@ module Cask sig { returns(String) } def self.command_name - @command_name ||= name.sub(/^.*:/, "").gsub(/(.)([A-Z])/, '\1_\2').downcase + @command_name ||= T.must(name).sub(/^.*:/, "").gsub(/(.)([A-Z])/, '\1_\2').downcase end sig { returns(T::Boolean) } def self.abstract? - name.split("::").last.match?(/^Abstract[^a-z]/) + T.must(name).split("::").fetch(-1).match?(/^Abstract[^a-z]/) end sig { returns(T::Boolean) } @@ -58,11 +58,6 @@ module Cask parser.generate_help_text end - sig { returns(String) } - def self.short_description - description[/\A[^.]*\./] - end - def self.run(*args) new(*args).run end