Refactor CLI::Cat.
This commit is contained in:
parent
1714c73b49
commit
58db95c1d2
@ -20,6 +20,10 @@ module Hbc
|
||||
def self.needs_init?
|
||||
false
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
@args = args
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -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, "")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user