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