Refactor CLI::InternalAppcastCheckpoint.
This commit is contained in:
parent
33580c283a
commit
326c425dc6
@ -2,14 +2,20 @@ module Hbc
|
|||||||
class CLI
|
class CLI
|
||||||
class InternalAppcastCheckpoint < InternalUseBase
|
class InternalAppcastCheckpoint < InternalUseBase
|
||||||
def self.run(*args)
|
def self.run(*args)
|
||||||
calculate = args.include? "--calculate"
|
new(*args).run
|
||||||
cask_tokens = cask_tokens_from(args)
|
end
|
||||||
raise CaskUnspecifiedError if cask_tokens.empty?
|
|
||||||
|
|
||||||
if cask_tokens.all? { |t| t =~ %r{^https?://} && t !~ /\.rb$/ }
|
def initialize(*args)
|
||||||
appcask_checkpoint_for_url(cask_tokens)
|
@cask_tokens = cask_tokens_from(args)
|
||||||
|
raise CaskUnspecifiedError if cask_tokens.empty?
|
||||||
|
@calculate = args.include? "--calculate"
|
||||||
|
end
|
||||||
|
|
||||||
|
def run
|
||||||
|
if @cask_tokens.all? { |t| t =~ %r{^https?://} && t !~ /\.rb$/ }
|
||||||
|
self.class.appcask_checkpoint_for_url(cask_tokens)
|
||||||
else
|
else
|
||||||
appcask_checkpoint(cask_tokens, calculate)
|
self.class.appcask_checkpoint(@cask_tokens, @calculate)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user