mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Rename Hbc
module to Cask
.
This commit is contained in:
parent
171ea3fe56
commit
a84a1c63db
@ -22,7 +22,7 @@ require "cask/artifact/suite"
|
||||
require "cask/artifact/uninstall"
|
||||
require "cask/artifact/zap"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
end
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class AbstractArtifact
|
||||
include Comparable
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/abstract_artifact"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class AbstractFlightBlock < AbstractArtifact
|
||||
def self.dsl_key
|
||||
|
@ -2,7 +2,7 @@ require "timeout"
|
||||
|
||||
require "cask/artifact/abstract_artifact"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class AbstractUninstall < AbstractArtifact
|
||||
ORDERED_DIRECTIVES = [
|
||||
@ -218,7 +218,7 @@ module Hbc
|
||||
def uninstall_pkgutil(*pkgs, command: nil, **_)
|
||||
ohai "Uninstalling packages:"
|
||||
pkgs.each do |regex|
|
||||
::Hbc::Pkg.all_matching(regex, command).each do |pkg|
|
||||
::Cask::Pkg.all_matching(regex, command).each do |pkg|
|
||||
puts pkg.package_id
|
||||
pkg.uninstall
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class App < Moved
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ require "cask/artifact/moved"
|
||||
require "extend/hash_validator"
|
||||
using HashValidator
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Artifact < Moved
|
||||
def self.english_name
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class AudioUnitPlugin < Moved
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/symlinked"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Binary < Symlinked
|
||||
def link(command: nil, **options)
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Colorpicker < Moved
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Dictionary < Moved
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Font < Moved
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class InputMethod < Moved
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ require "cask/artifact/abstract_artifact"
|
||||
require "extend/hash_validator"
|
||||
using HashValidator
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Installer < AbstractArtifact
|
||||
VALID_KEYS = Set.new [
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class InternetPlugin < Moved
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/relocated"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Moved < Relocated
|
||||
def self.english_description
|
||||
|
@ -5,7 +5,7 @@ require "cask/artifact/abstract_artifact"
|
||||
require "extend/hash_validator"
|
||||
using HashValidator
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Pkg < AbstractArtifact
|
||||
attr_reader :pkg_relative_path
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/abstract_flight_block"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class PostflightBlock < AbstractFlightBlock
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/abstract_flight_block"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class PreflightBlock < AbstractFlightBlock
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Prefpane < Moved
|
||||
def self.english_name
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Qlplugin < Moved
|
||||
def self.english_name
|
||||
|
@ -3,7 +3,7 @@ require "cask/artifact/abstract_artifact"
|
||||
require "extend/hash_validator"
|
||||
using HashValidator
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Relocated < AbstractArtifact
|
||||
def self.from_args(cask, *args)
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class ScreenSaver < Moved
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Service < Moved
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/abstract_artifact"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class StageOnly < AbstractArtifact
|
||||
def self.from_args(cask, *args)
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Suite < Moved
|
||||
def self.english_name
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/relocated"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Symlinked < Relocated
|
||||
def self.link_type_english_name
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/abstract_uninstall"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Uninstall < AbstractUninstall
|
||||
def uninstall_phase(**options)
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Vst3Plugin < Moved
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/moved"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class VstPlugin < Moved
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/artifact/abstract_uninstall"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Artifact
|
||||
class Zap < AbstractUninstall
|
||||
def zap_phase(**options)
|
||||
|
@ -3,7 +3,7 @@ require "cask/download"
|
||||
require "digest"
|
||||
require "utils/git"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Audit
|
||||
include Checkable
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/download"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Auditor
|
||||
def self.audit(cask, audit_download: false, check_token_conflicts: false, quarantine: true, commit_range: nil)
|
||||
new(cask, audit_download, check_token_conflicts, quarantine, commit_range).audit
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
module Cache
|
||||
module_function
|
||||
|
||||
|
@ -4,7 +4,7 @@ require "cask/dsl"
|
||||
require "cask/metadata"
|
||||
require "searchable"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cask
|
||||
extend Enumerable
|
||||
extend Forwardable
|
||||
|
@ -2,7 +2,7 @@ require "delegate"
|
||||
|
||||
require "cask/topological_hash"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class CaskDependencies < DelegateClass(Array)
|
||||
attr_reader :cask, :graph
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
require "cask/cask"
|
||||
require "uri"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module CaskLoader
|
||||
class FromContentLoader
|
||||
attr_reader :content
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
module Caskroom
|
||||
module_function
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
module Checkable
|
||||
def errors
|
||||
@errors ||= []
|
||||
|
@ -29,7 +29,7 @@ require "cask/cmd/abstract_internal_command"
|
||||
require "cask/cmd/internal_help"
|
||||
require "cask/cmd/internal_stanza"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
ALIASES = {
|
||||
"ls" => "list",
|
||||
|
@ -1,7 +1,7 @@
|
||||
require_relative "options"
|
||||
require "search"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class AbstractCommand
|
||||
include Options
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class AbstractInternalCommand < AbstractCommand
|
||||
def self.command_name
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Audit < AbstractCommand
|
||||
option "--download", :download, false
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Cat < AbstractCommand
|
||||
def initialize(*)
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Create < AbstractCommand
|
||||
def initialize(*)
|
||||
|
@ -1,7 +1,7 @@
|
||||
require "system_config"
|
||||
require "cask/checkable"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Doctor < AbstractCommand
|
||||
include Checkable
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Edit < AbstractCommand
|
||||
def initialize(*)
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/download"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Fetch < AbstractCommand
|
||||
option "--force", :force, false
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Home < AbstractCommand
|
||||
def run
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "json"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Info < AbstractCommand
|
||||
option "--json=VERSION", :json
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Install < AbstractCommand
|
||||
option "--force", :force, false
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class InternalHelp < AbstractInternalCommand
|
||||
def initialize(*)
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class InternalStanza < AbstractInternalCommand
|
||||
# Syntax
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class List < AbstractCommand
|
||||
option "-1", :one, false
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
module Options
|
||||
def self.included(klass)
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Outdated < AbstractCommand
|
||||
option "--greedy", :greedy, false
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Reinstall < Install
|
||||
def run
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Style < AbstractCommand
|
||||
def self.help
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Uninstall < AbstractCommand
|
||||
option "--force", :force, false
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Upgrade < AbstractCommand
|
||||
option "--greedy", :greedy, false
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Zap < AbstractCommand
|
||||
option "--force", :force, false
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Config
|
||||
def self.global
|
||||
@global ||= new
|
||||
|
@ -3,7 +3,7 @@ require "cask/cache"
|
||||
require "cask/quarantine"
|
||||
require "cask/verify"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Download
|
||||
attr_reader :cask
|
||||
|
||||
|
@ -20,7 +20,7 @@ require "cask/dsl/version"
|
||||
|
||||
require "cask/url"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
ORDINARY_ARTIFACT_CLASSES = [
|
||||
Artifact::Installer,
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
class Appcast
|
||||
attr_reader :uri, :checkpoint, :parameters
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
class Base
|
||||
extend Forwardable
|
||||
|
@ -5,7 +5,7 @@
|
||||
# ( The return value of the last method in the block is also sent
|
||||
# to the output by the caller, but that feature is only for the
|
||||
# convenience of Cask authors. )
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
class Caveats < Base
|
||||
def initialize(*args)
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
class ConflictsWith
|
||||
VALID_KEYS = Set.new [
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "unpack_strategy"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
class Container
|
||||
VALID_KEYS = Set.new [
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "rubygems"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
class DependsOn < DelegateClass(Hash)
|
||||
VALID_KEYS = Set.new [
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/staged"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
class Postflight < Base
|
||||
include Staged
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
class Preflight < Base
|
||||
include Staged
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
class UninstallPostflight < Base
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cask/staged"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
class UninstallPreflight < Base
|
||||
include Staged
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
class Version < ::String
|
||||
DIVIDERS = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class CaskError < RuntimeError; end
|
||||
|
||||
class AbstractCaskErrorWithToken < CaskError
|
||||
|
@ -11,10 +11,10 @@ require "cask/quarantine"
|
||||
|
||||
require "cgi"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Installer
|
||||
extend Predicable
|
||||
# TODO: it is unwise for Hbc::Staged to be a module, when we are
|
||||
# TODO: it is unwise for Cask::Staged to be a module, when we are
|
||||
# dealing with both staged and unstaged Casks here. This should
|
||||
# either be a class which is only sometimes instantiated, or there
|
||||
# should be explicit checks on whether staged state is valid in
|
||||
@ -54,7 +54,7 @@ module Hbc
|
||||
end
|
||||
|
||||
def fetch
|
||||
odebug "Hbc::Installer#fetch"
|
||||
odebug "Cask::Installer#fetch"
|
||||
|
||||
satisfy_dependencies
|
||||
|
||||
@ -64,7 +64,7 @@ module Hbc
|
||||
end
|
||||
|
||||
def stage
|
||||
odebug "Hbc::Installer#stage"
|
||||
odebug "Cask::Installer#stage"
|
||||
|
||||
Caskroom.ensure_caskroom_exists
|
||||
|
||||
@ -78,7 +78,7 @@ module Hbc
|
||||
end
|
||||
|
||||
def install
|
||||
odebug "Hbc::Installer#install"
|
||||
odebug "Cask::Installer#install"
|
||||
|
||||
if @cask.installed? && !force? && !@reinstall && !upgrade?
|
||||
raise CaskAlreadyInstalledError, @cask
|
||||
@ -119,7 +119,7 @@ module Hbc
|
||||
end
|
||||
|
||||
def reinstall
|
||||
odebug "Hbc::Installer#reinstall"
|
||||
odebug "Cask::Installer#reinstall"
|
||||
@reinstall = true
|
||||
install
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
module Metadata
|
||||
METADATA_SUBDIR = ".metadata".freeze
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class Pkg
|
||||
def self.all_matching(regexp, command)
|
||||
command.run("/usr/sbin/pkgutil", args: ["--pkgs=#{regexp}"]).stdout.split("\n").map do |package_id|
|
||||
|
@ -1,5 +1,5 @@
|
||||
require "development_tools"
|
||||
module Hbc
|
||||
module Cask
|
||||
module Quarantine
|
||||
module_function
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
module Staged
|
||||
def info_plist_file(index = 0)
|
||||
index = 0 if index == :first
|
||||
|
@ -1,7 +1,7 @@
|
||||
require "tsort"
|
||||
|
||||
# a basic topologically sortable hashmap
|
||||
module Hbc
|
||||
module Cask
|
||||
class TopologicalHash < Hash
|
||||
include TSort
|
||||
|
||||
|
@ -4,7 +4,7 @@ require "stringio"
|
||||
|
||||
BUG_REPORTS_URL = "https://github.com/Homebrew/homebrew-cask#reporting-bugs".freeze
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
module Utils
|
||||
def self.gain_permissions_remove(path, command: SystemCommand)
|
||||
if path.respond_to?(:rmtree) && path.exist?
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
module Verify
|
||||
module_function
|
||||
|
||||
|
@ -112,8 +112,8 @@ module CleanupRefinement
|
||||
return false unless name = basename.to_s[/\A(.*?)\-\-/, 1]
|
||||
|
||||
cask = begin
|
||||
Hbc::CaskLoader.load(name)
|
||||
rescue Hbc::CaskUnavailableError
|
||||
Cask::CaskLoader.load(name)
|
||||
rescue Cask::CaskUnavailableError
|
||||
return false
|
||||
end
|
||||
|
||||
@ -172,8 +172,8 @@ module Homebrew
|
||||
end
|
||||
|
||||
cask = begin
|
||||
Hbc::CaskLoader.load(arg)
|
||||
rescue Hbc::CaskUnavailableError
|
||||
Cask::CaskLoader.load(arg)
|
||||
rescue Cask::CaskUnavailableError
|
||||
nil
|
||||
end
|
||||
|
||||
|
@ -4,6 +4,6 @@ module Homebrew
|
||||
module_function
|
||||
|
||||
def cask
|
||||
Hbc::Cmd.run(*ARGV)
|
||||
Cask::Cmd.run(*ARGV)
|
||||
end
|
||||
end
|
||||
|
@ -64,7 +64,7 @@ module Homebrew
|
||||
|
||||
if args.remaining.empty?
|
||||
if args.casks?
|
||||
puts Formatter.columns(Hbc::Cask.to_a.map(&:full_name).sort)
|
||||
puts Formatter.columns(Cask::Cask.to_a.map(&:full_name).sort)
|
||||
else
|
||||
puts Formatter.columns(Formula.full_names.sort)
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ require "compat/cask/cache"
|
||||
require "compat/cask/caskroom"
|
||||
require "compat/cask/dsl"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class << self
|
||||
module Compat
|
||||
def init
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
module Cache
|
||||
class << self
|
||||
module Compat
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
module CaskLoader
|
||||
class FromContentLoader; end
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
module Caskroom
|
||||
class << self
|
||||
module Compat
|
||||
|
@ -1,7 +1,7 @@
|
||||
require "cask/cmd/abstract_command"
|
||||
require "cmd/--version"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Version < AbstractCommand
|
||||
def self.command_name
|
||||
|
@ -3,7 +3,7 @@ require "cleanup"
|
||||
|
||||
using CleanupRefinement
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
class Cleanup < AbstractCommand
|
||||
OUTDATED_DAYS = 10
|
||||
|
@ -1,7 +1,7 @@
|
||||
require "cask/cmd/abstract_command"
|
||||
require "cmd/search"
|
||||
|
||||
module Hbc
|
||||
module Cask
|
||||
class Cmd
|
||||
module Compat
|
||||
class Search < AbstractCommand
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Hbc
|
||||
module Cask
|
||||
class DSL
|
||||
module Compat
|
||||
def gpg(*)
|
||||
|
@ -10,7 +10,7 @@ module Homebrew
|
||||
puts
|
||||
|
||||
ohai "Casks"
|
||||
Hbc::Cask.to_a.extend(Searchable)
|
||||
Cask::Cask.to_a.extend(Searchable)
|
||||
.search(string_or_regex, &:name)
|
||||
.each do |cask|
|
||||
puts "#{Tty.bold}#{cask.token}:#{Tty.reset} #{cask.name.join(", ")}"
|
||||
@ -20,13 +20,13 @@ module Homebrew
|
||||
def search_casks(string_or_regex)
|
||||
if string_or_regex.is_a?(String) && string_or_regex.match?(HOMEBREW_TAP_CASK_REGEX)
|
||||
return begin
|
||||
[Hbc::CaskLoader.load(string_or_regex).token]
|
||||
rescue Hbc::CaskUnavailableError
|
||||
[Cask::CaskLoader.load(string_or_regex).token]
|
||||
rescue Cask::CaskUnavailableError
|
||||
[]
|
||||
end
|
||||
end
|
||||
|
||||
results = Hbc::Cask.search(string_or_regex, &:token).sort_by(&:token)
|
||||
results = Cask::Cask.search(string_or_regex, &:token).sort_by(&:token)
|
||||
|
||||
results.map do |cask|
|
||||
if cask.installed?
|
||||
|
@ -1,9 +1,9 @@
|
||||
# TODO: this test should be named after the corresponding class, once
|
||||
# that class is abstracted from installer.rb.
|
||||
describe "Accessibility Access", :cask do
|
||||
let(:cask) { Hbc::CaskLoader.load(cask_path("with-accessibility-access")) }
|
||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-accessibility-access")) }
|
||||
let(:fake_system_command) { class_double(SystemCommand) }
|
||||
let(:installer) { Hbc::Installer.new(cask, command: fake_system_command) }
|
||||
let(:installer) { Cask::Installer.new(cask, command: fake_system_command) }
|
||||
|
||||
before do
|
||||
allow(MacOS).to receive(:version).and_return(MacOS::Version.new(macos_version))
|
||||
|
@ -1,6 +1,6 @@
|
||||
describe Hbc::Artifact::App, :cask do
|
||||
describe Cask::Artifact::App, :cask do
|
||||
describe "activate to alternate target" do
|
||||
let(:cask) { Hbc::CaskLoader.load(cask_path("with-alt-target")) }
|
||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-alt-target")) }
|
||||
|
||||
let(:install_phase) {
|
||||
lambda do
|
||||
@ -11,7 +11,7 @@ describe Hbc::Artifact::App, :cask do
|
||||
}
|
||||
|
||||
let(:source_path) { cask.staged_path.join("Caffeine.app") }
|
||||
let(:target_path) { Hbc::Config.global.appdir.join("AnotherName.app") }
|
||||
let(:target_path) { Cask::Config.global.appdir.join("AnotherName.app") }
|
||||
|
||||
before do
|
||||
InstallHelper.install_without_artifacts(cask)
|
||||
@ -29,7 +29,7 @@ describe Hbc::Artifact::App, :cask do
|
||||
|
||||
describe "when app is in a subdirectory" do
|
||||
let(:cask) {
|
||||
Hbc::Cask.new("subdir") do
|
||||
Cask::Cask.new("subdir") do
|
||||
url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip"
|
||||
homepage "https://example.com/local-caffeine"
|
||||
version "1.2.3"
|
||||
@ -58,14 +58,14 @@ describe Hbc::Artifact::App, :cask do
|
||||
expect(target_path).to be_a_directory
|
||||
expect(source_path).not_to exist
|
||||
|
||||
expect(Hbc::Config.global.appdir.join("Caffeine Deluxe.app")).not_to exist
|
||||
expect(Cask::Config.global.appdir.join("Caffeine Deluxe.app")).not_to exist
|
||||
expect(cask.staged_path.join("Caffeine Deluxe.app")).to be_a_directory
|
||||
end
|
||||
|
||||
it "avoids clobbering an existing app by moving over it" do
|
||||
target_path.mkpath
|
||||
|
||||
expect(install_phase).to raise_error(Hbc::CaskError, "It seems there is already an App at '#{target_path}'.")
|
||||
expect(install_phase).to raise_error(Cask::CaskError, "It seems there is already an App at '#{target_path}'.")
|
||||
|
||||
expect(source_path).to be_a_directory
|
||||
expect(target_path).to be_a_directory
|
||||
|
@ -1,11 +1,11 @@
|
||||
describe Hbc::Artifact::App, :cask do
|
||||
let(:cask) { Hbc::CaskLoader.load(cask_path("local-caffeine")) }
|
||||
describe Cask::Artifact::App, :cask do
|
||||
let(:cask) { Cask::CaskLoader.load(cask_path("local-caffeine")) }
|
||||
let(:command) { SystemCommand }
|
||||
let(:force) { false }
|
||||
let(:app) { cask.artifacts.find { |a| a.is_a?(described_class) } }
|
||||
|
||||
let(:source_path) { cask.staged_path.join("Caffeine.app") }
|
||||
let(:target_path) { Hbc::Config.global.appdir.join("Caffeine.app") }
|
||||
let(:target_path) { Cask::Config.global.appdir.join("Caffeine.app") }
|
||||
|
||||
let(:install_phase) { app.install_phase(command: command, force: force) }
|
||||
let(:uninstall_phase) { app.uninstall_phase(command: command, force: force) }
|
||||
@ -24,7 +24,7 @@ describe Hbc::Artifact::App, :cask do
|
||||
|
||||
describe "when app is in a subdirectory" do
|
||||
let(:cask) {
|
||||
Hbc::Cask.new("subdir") do
|
||||
Cask::Cask.new("subdir") do
|
||||
url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip"
|
||||
homepage "https://example.com/local-caffeine"
|
||||
version "1.2.3"
|
||||
@ -53,7 +53,7 @@ describe Hbc::Artifact::App, :cask do
|
||||
expect(target_path).to be_a_directory
|
||||
expect(source_path).not_to exist
|
||||
|
||||
expect(Hbc::Config.global.appdir.join("Caffeine Deluxe.app")).not_to exist
|
||||
expect(Cask::Config.global.appdir.join("Caffeine Deluxe.app")).not_to exist
|
||||
expect(cask.staged_path.join("Caffeine Deluxe.app")).to exist
|
||||
end
|
||||
|
||||
@ -64,7 +64,7 @@ describe Hbc::Artifact::App, :cask do
|
||||
|
||||
it "avoids clobbering an existing app" do
|
||||
expect { install_phase }.to raise_error(
|
||||
Hbc::CaskError,
|
||||
Cask::CaskError,
|
||||
"It seems there is already an App at '#{target_path}'.",
|
||||
)
|
||||
|
||||
@ -80,7 +80,7 @@ describe Hbc::Artifact::App, :cask do
|
||||
let(:force) { true }
|
||||
|
||||
before do
|
||||
allow(Hbc::Utils).to receive(:current_user).and_return("fake_user")
|
||||
allow(Cask::Utils).to receive(:current_user).and_return("fake_user")
|
||||
end
|
||||
|
||||
describe "target is both writable and user-owned" do
|
||||
@ -167,7 +167,7 @@ describe Hbc::Artifact::App, :cask do
|
||||
|
||||
it "leaves the target alone" do
|
||||
expect { install_phase }.to raise_error(
|
||||
Hbc::CaskError, "It seems there is already an App at '#{target_path}'."
|
||||
Cask::CaskError, "It seems there is already an App at '#{target_path}'."
|
||||
)
|
||||
expect(target_path).to be_a_symlink
|
||||
end
|
||||
@ -203,7 +203,7 @@ describe Hbc::Artifact::App, :cask do
|
||||
|
||||
message = "It seems the App source '#{source_path}' is not there."
|
||||
|
||||
expect { install_phase }.to raise_error(Hbc::CaskError, message)
|
||||
expect { install_phase }.to raise_error(Cask::CaskError, message)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
describe Hbc::Artifact::Binary, :cask do
|
||||
describe Cask::Artifact::Binary, :cask do
|
||||
let(:cask) {
|
||||
Hbc::CaskLoader.load(cask_path("with-binary")).tap do |cask|
|
||||
Cask::CaskLoader.load(cask_path("with-binary")).tap do |cask|
|
||||
InstallHelper.install_without_artifacts(cask)
|
||||
end
|
||||
}
|
||||
let(:artifacts) { cask.artifacts.select { |a| a.is_a?(described_class) } }
|
||||
let(:expected_path) { Hbc::Config.global.binarydir.join("binary") }
|
||||
let(:expected_path) { Cask::Config.global.binarydir.join("binary") }
|
||||
|
||||
after do
|
||||
FileUtils.rm expected_path if expected_path.exist?
|
||||
@ -13,11 +13,11 @@ describe Hbc::Artifact::Binary, :cask do
|
||||
|
||||
context "when --no-binaries is specified" do
|
||||
let(:cask) {
|
||||
Hbc::CaskLoader.load(cask_path("with-binary"))
|
||||
Cask::CaskLoader.load(cask_path("with-binary"))
|
||||
}
|
||||
|
||||
it "doesn't link the binary when --no-binaries is specified" do
|
||||
Hbc::Installer.new(cask, binaries: false).install
|
||||
Cask::Installer.new(cask, binaries: false).install
|
||||
expect(expected_path).not_to exist
|
||||
end
|
||||
end
|
||||
@ -33,12 +33,12 @@ describe Hbc::Artifact::Binary, :cask do
|
||||
|
||||
context "when the binary is not executable" do
|
||||
let(:cask) {
|
||||
Hbc::CaskLoader.load(cask_path("with-non-executable-binary")).tap do |cask|
|
||||
Cask::CaskLoader.load(cask_path("with-non-executable-binary")).tap do |cask|
|
||||
InstallHelper.install_without_artifacts(cask)
|
||||
end
|
||||
}
|
||||
|
||||
let(:expected_path) { Hbc::Config.global.binarydir.join("naked_non_executable") }
|
||||
let(:expected_path) { Cask::Config.global.binarydir.join("naked_non_executable") }
|
||||
|
||||
it "makes the binary executable" do
|
||||
expect(FileUtils).to receive(:chmod)
|
||||
@ -60,7 +60,7 @@ describe Hbc::Artifact::Binary, :cask do
|
||||
artifacts.each do |artifact|
|
||||
artifact.install_phase(command: NeverSudoSystemCommand, force: false)
|
||||
end
|
||||
}.to raise_error(Hbc::CaskError)
|
||||
}.to raise_error(Cask::CaskError)
|
||||
|
||||
expect(expected_path).not_to be :symlink?
|
||||
end
|
||||
@ -76,7 +76,7 @@ describe Hbc::Artifact::Binary, :cask do
|
||||
end
|
||||
|
||||
it "creates parent directory if it doesn't exist" do
|
||||
FileUtils.rmdir Hbc::Config.global.binarydir
|
||||
FileUtils.rmdir Cask::Config.global.binarydir
|
||||
|
||||
artifacts.each do |artifact|
|
||||
artifact.install_phase(command: NeverSudoSystemCommand, force: false)
|
||||
@ -87,13 +87,13 @@ describe Hbc::Artifact::Binary, :cask do
|
||||
|
||||
context "binary is inside an app package" do
|
||||
let(:cask) {
|
||||
Hbc::CaskLoader.load(cask_path("with-embedded-binary")).tap do |cask|
|
||||
Cask::CaskLoader.load(cask_path("with-embedded-binary")).tap do |cask|
|
||||
InstallHelper.install_without_artifacts(cask)
|
||||
end
|
||||
}
|
||||
|
||||
it "links the binary to the proper directory" do
|
||||
cask.artifacts.select { |a| a.is_a?(Hbc::Artifact::App) }.each do |artifact|
|
||||
cask.artifacts.select { |a| a.is_a?(Cask::Artifact::App) }.each do |artifact|
|
||||
artifact.install_phase(command: NeverSudoSystemCommand, force: false)
|
||||
end
|
||||
artifacts.each do |artifact|
|
||||
|
@ -1,5 +1,5 @@
|
||||
describe Hbc::Artifact::Artifact, :cask do
|
||||
let(:cask) { Hbc::CaskLoader.load(cask_path("with-generic-artifact")) }
|
||||
describe Cask::Artifact::Artifact, :cask do
|
||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-generic-artifact")) }
|
||||
|
||||
let(:install_phase) {
|
||||
lambda do
|
||||
@ -10,7 +10,7 @@ describe Hbc::Artifact::Artifact, :cask do
|
||||
}
|
||||
|
||||
let(:source_path) { cask.staged_path.join("Caffeine.app") }
|
||||
let(:target_path) { Hbc::Config.global.appdir.join("Caffeine.app") }
|
||||
let(:target_path) { Cask::Config.global.appdir.join("Caffeine.app") }
|
||||
|
||||
before do
|
||||
InstallHelper.install_without_artifacts(cask)
|
||||
@ -19,8 +19,8 @@ describe Hbc::Artifact::Artifact, :cask do
|
||||
context "without target" do
|
||||
it "fails to load" do
|
||||
expect {
|
||||
Hbc::CaskLoader.load(cask_path("invalid/invalid-generic-artifact-no-target"))
|
||||
}.to raise_error(Hbc::CaskInvalidError, /target required for Generic Artifact/)
|
||||
Cask::CaskLoader.load(cask_path("invalid/invalid-generic-artifact-no-target"))
|
||||
}.to raise_error(Cask::CaskInvalidError, /target required for Generic Artifact/)
|
||||
end
|
||||
end
|
||||
|
||||
@ -36,7 +36,7 @@ describe Hbc::Artifact::Artifact, :cask do
|
||||
|
||||
expect {
|
||||
install_phase.call
|
||||
}.to raise_error(Hbc::CaskError)
|
||||
}.to raise_error(Cask::CaskError)
|
||||
|
||||
expect(source_path).to be_a_directory
|
||||
expect(target_path).to be_a_directory
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user