Remove redundant self.run methods.
This commit is contained in:
parent
acc7309ca3
commit
debe4540e4
@ -5,10 +5,6 @@ module Hbc
|
||||
"--#{super}"
|
||||
end
|
||||
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def run
|
||||
raise ArgumentError, "#{self.class.command_name} does not take arguments." unless @args.empty?
|
||||
puts Hbc.full_version
|
||||
|
||||
@ -5,10 +5,6 @@ module Hbc
|
||||
"verifies installability of Casks"
|
||||
end
|
||||
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def initialize(*args, auditor: Auditor)
|
||||
@args = args
|
||||
@auditor = auditor
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class Cat < AbstractCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def run
|
||||
cask_tokens = self.class.cask_tokens_from(@args)
|
||||
raise CaskUnspecifiedError if cask_tokens.empty?
|
||||
|
||||
@ -12,10 +12,6 @@ module Hbc
|
||||
true
|
||||
end
|
||||
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
attr_reader :cache_location, :outdated_only
|
||||
|
||||
def initialize(*args, cache_location: Hbc.cache, outdated_only: CLI.outdated?)
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class Create < AbstractCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def run
|
||||
cask_tokens = self.class.cask_tokens_from(@args)
|
||||
raise CaskUnspecifiedError if cask_tokens.empty?
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class Edit < AbstractCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def run
|
||||
cask_tokens = self.class.cask_tokens_from(@args)
|
||||
raise CaskUnspecifiedError if cask_tokens.empty?
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class Fetch < AbstractCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def run
|
||||
cask_tokens = self.class.cask_tokens_from(@args)
|
||||
raise CaskUnspecifiedError if cask_tokens.empty?
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class Info < AbstractCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
@cask_tokens = self.class.cask_tokens_from(args)
|
||||
raise CaskUnspecifiedError if @cask_tokens.empty?
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class Install < AbstractCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
@cask_tokens = self.class.cask_tokens_from(args)
|
||||
raise CaskUnspecifiedError if @cask_tokens.empty?
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class InternalAppcastCheckpoint < AbstractInternalCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
@cask_tokens = cask_tokens_from(args)
|
||||
raise CaskUnspecifiedError if cask_tokens.empty?
|
||||
|
||||
@ -7,10 +7,6 @@ module Hbc
|
||||
true
|
||||
end
|
||||
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
@commit_range = self.class.commit_range(args)
|
||||
@cleanup = args.any? { |a| a =~ /^-+c(leanup)?$/i }
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class InternalCheckurl < AbstractInternalCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def run
|
||||
casks_to_check = @args.empty? ? Hbc.all : @args.map { |arg| CaskLoader.load(arg) }
|
||||
casks_to_check.each do |cask|
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class InternalDump < AbstractInternalCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
@cask_tokens = self.class.cask_tokens_from(args)
|
||||
raise CaskUnspecifiedError if @cask_tokens.empty?
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class InternalHelp < AbstractInternalCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def run
|
||||
max_command_len = CLI.commands.map(&:length).max
|
||||
puts "Unstable Internal-use Commands:\n\n"
|
||||
|
||||
@ -50,10 +50,6 @@ module Hbc
|
||||
:uninstall_postflight,
|
||||
]
|
||||
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
raise ArgumentError, "No stanza given." if args.empty?
|
||||
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class List < AbstractCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
@cask_tokens = self.class.cask_tokens_from(args)
|
||||
@one = true if args.delete("-1")
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class Outdated < AbstractCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
@cask_tokens = self.class.cask_tokens_from(args)
|
||||
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class Search < AbstractCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def run
|
||||
self.class.render_results(*self.class.search(*@args))
|
||||
end
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class Uninstall < AbstractCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
@cask_tokens = self.class.cask_tokens_from(args)
|
||||
raise CaskUnspecifiedError if @cask_tokens.empty?
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
module Hbc
|
||||
class CLI
|
||||
class Zap < AbstractCommand
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
@cask_tokens = self.class.cask_tokens_from(args)
|
||||
raise CaskUnspecifiedError if @cask_tokens.empty?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user