aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/base.rb4
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/cat.rb6
2 files changed, 9 insertions, 1 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/base.rb b/Library/Homebrew/cask/lib/hbc/cli/base.rb
index 3301cad91..1ad347de3 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 52f6e0eab..774b96e89 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, "")