Remove Hbc.init.
This commit is contained in:
parent
b2f67c6d77
commit
488149242b
@ -25,9 +25,3 @@ require "hbc/url"
|
||||
require "hbc/utils"
|
||||
require "hbc/verify"
|
||||
require "hbc/version"
|
||||
|
||||
module Hbc
|
||||
def self.init
|
||||
Caskroom.ensure_caskroom_exists
|
||||
end
|
||||
end
|
||||
|
||||
@ -21,6 +21,8 @@ module Hbc
|
||||
end
|
||||
|
||||
def casks
|
||||
return [] unless path.exist?
|
||||
|
||||
Pathname.glob(path.join("*")).sort.select(&:directory?).map do |path|
|
||||
token = path.basename.to_s
|
||||
|
||||
|
||||
@ -88,10 +88,6 @@ module Hbc
|
||||
@lookup.fetch(command_name, command_name)
|
||||
end
|
||||
|
||||
def self.should_init?(command)
|
||||
command.is_a?(Class) && !command.abstract? && command.needs_init?
|
||||
end
|
||||
|
||||
def self.run_command(command, *args)
|
||||
if command.respond_to?(:run)
|
||||
# usual case: built-in command verb
|
||||
@ -164,7 +160,6 @@ module Hbc
|
||||
MacOS.full_version = ENV["MACOS_VERSION"] unless ENV["MACOS_VERSION"].nil?
|
||||
|
||||
Tap.default_cask_tap.install unless Tap.default_cask_tap.installed?
|
||||
Hbc.init if self.class.should_init?(command)
|
||||
self.class.run_command(command, *args)
|
||||
rescue CaskError, ArgumentError, OptionParser::InvalidOption => e
|
||||
msg = e.message
|
||||
|
||||
@ -27,10 +27,6 @@ module Hbc
|
||||
nil
|
||||
end
|
||||
|
||||
def self.needs_init?
|
||||
false
|
||||
end
|
||||
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
@ -20,10 +20,6 @@ module Hbc
|
||||
odebug "Auditing Cask #{cask}"
|
||||
Auditor.audit(cask, audit_download: download?, check_token_conflicts: token_conflicts?)
|
||||
end
|
||||
|
||||
def self.needs_init?
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -27,10 +27,6 @@ module Hbc
|
||||
def self.help
|
||||
"installs the given Cask"
|
||||
end
|
||||
|
||||
def self.needs_init?
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -49,10 +49,6 @@ module Hbc
|
||||
def self.help
|
||||
"prints or calculates a given Cask's or URL's appcast checkpoint"
|
||||
end
|
||||
|
||||
def self.needs_init?
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -5,10 +5,6 @@ module Hbc
|
||||
|
||||
option "--cleanup", :cleanup, false
|
||||
|
||||
def self.needs_init?
|
||||
true
|
||||
end
|
||||
|
||||
attr_accessor :commit_range
|
||||
private :commit_range=
|
||||
|
||||
|
||||
@ -57,10 +57,6 @@ module Hbc
|
||||
def self.help
|
||||
"with no args, lists installed Casks; given installed Casks, lists staged files"
|
||||
end
|
||||
|
||||
def self.needs_init?
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -82,10 +82,6 @@ module Hbc
|
||||
def self.help
|
||||
"upgrades all outdated casks"
|
||||
end
|
||||
|
||||
def self.needs_init?
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -55,6 +55,8 @@ module Hbc
|
||||
def stage
|
||||
odebug "Hbc::Installer#stage"
|
||||
|
||||
Caskroom.ensure_caskroom_exists
|
||||
|
||||
extract_primary_container
|
||||
save_caskfile
|
||||
rescue StandardError => e
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user