Remove redundant self.run methods.

This commit is contained in:
Markus Reiter 2017-05-20 19:11:34 +02:00
parent acc7309ca3
commit debe4540e4
20 changed files with 0 additions and 80 deletions

View File

@ -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

View File

@ -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

View File

@ -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?

View File

@ -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?)

View File

@ -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?

View File

@ -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?

View File

@ -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?

View File

@ -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?

View File

@ -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?

View File

@ -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?

View File

@ -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 }

View File

@ -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|

View File

@ -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?

View File

@ -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"

View File

@ -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?

View File

@ -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")

View File

@ -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)

View File

@ -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

View File

@ -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?

View File

@ -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?