From 9cfd04381733b6d39c35cfbd95b382fb2c533376 Mon Sep 17 00:00:00 2001 From: jcsanti Date: Tue, 15 Aug 2023 21:00:33 +0200 Subject: [PATCH] Fix call to deleted method In commit a3231a03fa171d7e701150957ef4f6f74c2b6948 of the homebrew/brew repository, the `Cask::Cask#versions` method was removed. We relied on this method to compute the `formatted_version` we wish to display to the user once the pinning is done. To achieve the same result, we can simply call `Cask#installed_version` instead. --- lib/bcu/command/pin_add.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bcu/command/pin_add.rb b/lib/bcu/command/pin_add.rb index d294d07..ebca00d 100644 --- a/lib/bcu/command/pin_add.rb +++ b/lib/bcu/command/pin_add.rb @@ -36,7 +36,7 @@ def run_add_pin(cask_name) end formatted_cask_name = "#{Tty.green}#{cask_name}#{Tty.reset}" - formatted_version = "#{Tty.magenta}#{cask.versions.first}#{Tty.reset}" + formatted_version = "#{Tty.magenta}#{cask.installed_version}#{Tty.reset}" puts "Pinned: #{formatted_cask_name} in version #{formatted_version}" end