From 171db283e70c9dcf79823912e30b75d5d8f824ed Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Sun, 4 May 2014 18:53:58 -0500 Subject: [PATCH 1/2] cut v0.34.0 --- doc/CHANGELOG.md | 21 +++++++++++++++++++++ lib/cask/version.rb | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 31f5c52ce2c56..03a97f56462fa 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,5 +1,26 @@ # CHANGELOG +## 0.34.0 + +* __Casks__ + - 19 Casks added (42 updated) by 39 contributors since 0.33.1 + - 1460 total Casks +* __Features__ + - [#2427][] Give the user help on checksum errors + - [#4169][] automatically transition to new Tap name/location + - [#4163][] update all references to new caskroom org home +* __Fixes__ + - none +* __Documentation__ + - none +* __Breaking Changes__ + - The repository has moved under the Caskroom organization. We expect this to + be a seamless transition for users. + +[#2427]: https://github.com/caskroom/homebrew-cask/issues/2427 +[#4169]: https://github.com/caskroom/homebrew-cask/issues/4169 +[#4163]: https://github.com/caskroom/homebrew-cask/issues/4163 + ## 0.33.1 * __Casks__ diff --git a/lib/cask/version.rb b/lib/cask/version.rb index 9ea99c26e4001..0c92d3312c588 100644 --- a/lib/cask/version.rb +++ b/lib/cask/version.rb @@ -1 +1 @@ -HOMEBREW_CASK_VERSION = '0.33.1' +HOMEBREW_CASK_VERSION = '0.34.0' From 9615a6aa108d4583ae7692bbea42806a8bc9d771 Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Mon, 5 May 2014 20:51:30 +0800 Subject: [PATCH 2/2] Add a `reinstall` command to cask. Right now there's no real automated way to update casks except than removing and reinstalling items. This patch acts as a stopgap measure to make manual updates slightly less painful, to be possibly deprecated once automated updates are in place. --- doc/man/brew-cask.1 | 4 ++++ doc/src/brew-cask.1.md | 3 +++ lib/cask/cli.rb | 1 + lib/cask/cli/reinstall.rb | 30 ++++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 lib/cask/cli/reinstall.rb diff --git a/doc/man/brew-cask.1 b/doc/man/brew-cask.1 index 60b4f579373c4..d87e85538f18a 100644 --- a/doc/man/brew-cask.1 +++ b/doc/man/brew-cask.1 @@ -26,6 +26,10 @@ Install \fICask\fR\. Uninstall \fICask\fR\. . .TP +\fBreinstall\fR \fICask\fR +Reinstall \fICask\fR\. +. +.TP \fBsearch\fR \fItext\fR | /\fIregexp\fR/ Perform a substring search of Cask names for \fItext\fR\. If the text is delimited by slashes, it is interpreted as a Ruby regular expression\. . diff --git a/doc/src/brew-cask.1.md b/doc/src/brew-cask.1.md index 93a1cdc5232d2..21c7401ea294e 100644 --- a/doc/src/brew-cask.1.md +++ b/doc/src/brew-cask.1.md @@ -84,6 +84,9 @@ names, and other aspects of this manual are still subject to change. * `uninstall` or `rm` or `remove` : Uninstall . + * `reinstall` : + Reinstall . + * `search` or `-S`: Display all Casks available for install. diff --git a/lib/cask/cli.rb b/lib/cask/cli.rb index 8cbcdec4b0635..1345118e7ce70 100644 --- a/lib/cask/cli.rb +++ b/lib/cask/cli.rb @@ -15,6 +15,7 @@ class Cask::CLI; end require 'cask/cli/info' require 'cask/cli/install' require 'cask/cli/list' +require 'cask/cli/reinstall' require 'cask/cli/search' require 'cask/cli/uninstall' require 'cask/cli/update' diff --git a/lib/cask/cli/reinstall.rb b/lib/cask/cli/reinstall.rb new file mode 100644 index 0000000000000..eb7e83b271f6d --- /dev/null +++ b/lib/cask/cli/reinstall.rb @@ -0,0 +1,30 @@ +class Cask::CLI::Reinstall + def self.run(*args) + raise CaskUnspecifiedError if args.empty? + cask_names = args.reject { |a| a.chars.first == '-' } + force = args.include? '--force' + cask_names.each do |cask_name| + odebug "Reinstalling Cask #{cask_name}" + cask = Cask.load(cask_name) + begin + if cask + Cask::Installer.new(cask).uninstall + end + Cask::Installer.new(cask).install(force) + rescue CaskUnavailableError => e + exact_match, partial_matches, search_term = Cask::CLI::Search.search(cask_name) + errmsg = "#{cask_name}" + if exact_match + errmsg.concat(". Did you mean:\n#{exact_match}") + elsif !partial_matches.empty? + errmsg.concat(". Did you mean one of:\n#{stringify_columns(partial_matches.take(20))}\n") + end + raise CaskUnavailableError.new(errmsg) + end + end + end + + def self.help + "reinstalls the cask of the given name" + end +end