diff --git a/Library/Homebrew/cask/lib/hbc/cli/base.rb b/Library/Homebrew/cask/lib/hbc/cli/base.rb index 3301cad91c..1ad347de3f 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/base.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/base.rb @@ -20,6 +20,10 @@ module Hbc def self.needs_init? false end + + def initialize(*args) + @args = args + end end end end diff --git a/Library/Homebrew/cask/lib/hbc/cli/cat.rb b/Library/Homebrew/cask/lib/hbc/cli/cat.rb index 52f6e0eabe..774b96e89c 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/cat.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/cat.rb @@ -2,7 +2,11 @@ module Hbc class CLI class Cat < Base def self.run(*args) - cask_tokens = cask_tokens_from(args) + new(*args).run + end + + def run + cask_tokens = self.class.cask_tokens_from(@args) raise CaskUnspecifiedError if cask_tokens.empty? # only respects the first argument cask_token = cask_tokens.first.sub(/\.rb$/i, "")