From 9189bd5be64ffa7e22e984e43f51f624e76bfbc5 Mon Sep 17 00:00:00 2001 From: phinze Date: Sun, 17 Feb 2013 12:51:20 -0600 Subject: [PATCH] Out of the Cellar, into the Caskroom Install casks into HOMEBREW_PREFIX/"Caskroom" instead of the Cellar. This prevents us from colliding with normal Homebrew Formulae. NOTE: this will be a breaking change, with the following effects: - all installed casks will no longer be reported as installed - orphans all existing casks in the Cellar - no automated facility for cleanup or migration of existing casks refs #38, where we can discuss the implications of this before cutting a new release --- lib/cask.rb | 7 ++++--- lib/cask/cli.rb | 4 ++++ test/cask/installer_test.rb | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/cask.rb b/lib/cask.rb index d8bc127ef..1e5c3c063 100644 --- a/lib/cask.rb +++ b/lib/cask.rb @@ -18,8 +18,8 @@ class Cask HOMEBREW_PREFIX.join "Library", "Taps" end - def self.cellarpath - HOMEBREW_CELLAR + def self.caskroom + HOMEBREW_PREFIX.join "Caskroom" end def self.appdir @@ -32,6 +32,7 @@ class Cask def self.init HOMEBREW_CACHE.mkpath unless HOMEBREW_CACHE.exist? + caskroom.mkpath unless caskroom.exist? appdir.mkpath unless appdir.exist? end @@ -57,7 +58,7 @@ class Cask end def destination_path - HOMEBREW_CELLAR.join(self.title).join(self.version) + self.class.caskroom.join(self.title).join(self.version) end def installed? diff --git a/lib/cask/cli.rb b/lib/cask/cli.rb index c67d40cdc..b2c22a4d8 100644 --- a/lib/cask/cli.rb +++ b/lib/cask/cli.rb @@ -78,6 +78,10 @@ class Cask::CLI puts Cask::CLI.commands.map {|c| " - #{c.downcase}: #{_help_for(c)}"}.join("\n") end + def help + '' + end + def _help_for(command) Cask::CLI.lookup_command(command).help end diff --git a/test/cask/installer_test.rb b/test/cask/installer_test.rb index 5ef361e86..086025386 100644 --- a/test/cask/installer_test.rb +++ b/test/cask/installer_test.rb @@ -9,7 +9,7 @@ describe Cask::Installer do Cask::Installer.install(caffeine) end - dest_path = HOMEBREW_CELLAR/'local-caffeine'/caffeine.version + dest_path = Cask.caskroom/'local-caffeine'/caffeine.version dest_path.must_be :directory? application = dest_path/'Caffeine.app' application.must_be :directory? @@ -22,7 +22,7 @@ describe Cask::Installer do Cask::Installer.install(transmission) end - dest_path = HOMEBREW_CELLAR/'local-transmission'/transmission.version + dest_path = Cask.caskroom/'local-transmission'/transmission.version dest_path.must_be :directory? application = dest_path/'Transmission.app' application.must_be :directory?