From 3a70652ebb96b9f1ef55cca69e606319d15122b9 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Tue, 25 Apr 2023 15:25:52 -0700 Subject: [PATCH] Resolve Style/InvertibleUnlessCondition violations (#145823) --- Casks/active-trader-pro.rb | 4 ++-- Casks/blurscreen.rb | 4 ++-- Casks/gamemaker.rb | 4 ++-- Casks/slicer.rb | 2 +- Casks/virtual-desktop-streamer.rb | 4 ++-- Casks/zoom.rb | 4 ++-- developer/bin/generate_cask_token | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Casks/active-trader-pro.rb b/Casks/active-trader-pro.rb index c8fbdd792a..9085885b5b 100644 --- a/Casks/active-trader-pro.rb +++ b/Casks/active-trader-pro.rb @@ -21,8 +21,8 @@ cask "active-trader-pro" do # `open -b com.fmr.activetrader`. Therefore, we must suppress this behavior # to make the cask installation non-interactive. retries ||= 3 - ohai "The Active Trader Pro package postinstall script launches the app" unless retries < 3 - ohai "Attempting to close Active Trader Pro to avoid unwanted user intervention" unless retries < 3 + ohai "The Active Trader Pro package postinstall script launches the app" if retries >= 3 + ohai "Attempting to close Active Trader Pro to avoid unwanted user intervention" if retries >= 3 return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/Active Trader Pro.app"] end diff --git a/Casks/blurscreen.rb b/Casks/blurscreen.rb index 8e3c1e6704..812bdb0cf9 100644 --- a/Casks/blurscreen.rb +++ b/Casks/blurscreen.rb @@ -22,8 +22,8 @@ cask "blurscreen" do # This is because `open "$APP_PATH"&` is called from the postinstall # script of the package and we don't want any user intervention there. retries ||= 3 - ohai "The BlurScreen package postinstall script launches the BlurScreen app" unless retries < 3 - ohai "Attempting to close BlurScreen.app to avoid unwanted user intervention" unless retries < 3 + ohai "The BlurScreen package postinstall script launches the BlurScreen app" if retries >= 3 + ohai "Attempting to close BlurScreen.app to avoid unwanted user intervention" if retries >= 3 return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/BlurScreen.app"] rescue RuntimeError diff --git a/Casks/gamemaker.rb b/Casks/gamemaker.rb index ddd0aca70c..85a04a1253 100644 --- a/Casks/gamemaker.rb +++ b/Casks/gamemaker.rb @@ -20,8 +20,8 @@ cask "gamemaker" do # This is because `open "$APP_PATH"&` is called from the postinstall # script of the package and we don't want any user intervention there. retries ||= 3 - ohai "The GameMaker package postinstall script launches the GameMaker app" unless retries < 3 - ohai "Attempting to close com.yoyogames.gms2 to avoid unwanted user intervention" unless retries < 3 + ohai "The GameMaker package postinstall script launches the GameMaker app" if retries >= 3 + ohai "Attempting to close com.yoyogames.gms2 to avoid unwanted user intervention" if retries >= 3 return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/GameMaker.app"] rescue RuntimeError diff --git a/Casks/slicer.rb b/Casks/slicer.rb index b7d557b809..be9c147b76 100644 --- a/Casks/slicer.rb +++ b/Casks/slicer.rb @@ -13,7 +13,7 @@ cask "slicer" do regex(%r{href=.*?/bitstream/(\h+)["' >].+?["']header["'][^>]*?>\s*v?(\d+(?:\.\d+)+)}im) strategy :page_match do |page, regex| match = page.scan(regex) - next unless match.length >= 2 + next if match.length < 2 "#{match[1][1]},#{match[1][0]}" end diff --git a/Casks/virtual-desktop-streamer.rb b/Casks/virtual-desktop-streamer.rb index 7eb146f3ba..fc4a91d847 100644 --- a/Casks/virtual-desktop-streamer.rb +++ b/Casks/virtual-desktop-streamer.rb @@ -16,8 +16,8 @@ cask "virtual-desktop-streamer" do postflight do # postinstall launches the app retries ||= 3 - ohai "The Virtual Desktop package postinstall script launches the Streamer app" unless retries < 3 - ohai "Attempting to close the Streamer app to avoid unwanted user intervention" unless retries < 3 + ohai "The Virtual Desktop package postinstall script launches the Streamer app" if retries >= 3 + ohai "Attempting to close the Streamer app to avoid unwanted user intervention" if retries >= 3 return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/Virtual Desktop Streamer.app"] rescue RuntimeError diff --git a/Casks/zoom.rb b/Casks/zoom.rb index 34cd85aebf..5e47dd72e8 100644 --- a/Casks/zoom.rb +++ b/Casks/zoom.rb @@ -25,8 +25,8 @@ cask "zoom" do # This is because `open "$APP_PATH"&` is called from the postinstall # script of the package and we don't want any user intervention there. retries ||= 3 - ohai "The Zoom package postinstall script launches the Zoom app" unless retries < 3 - ohai "Attempting to close zoom.us.app to avoid unwanted user intervention" unless retries < 3 + ohai "The Zoom package postinstall script launches the Zoom app" if retries >= 3 + ohai "Attempting to close zoom.us.app to avoid unwanted user intervention" if retries >= 3 return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/zoom.us.app"] rescue RuntimeError diff --git a/developer/bin/generate_cask_token b/developer/bin/generate_cask_token index 8fa54772f4..32f1898fd8 100755 --- a/developer/bin/generate_cask_token +++ b/developer/bin/generate_cask_token @@ -406,7 +406,7 @@ if /^-+debug?$/i.match?(ARGV.first) ARGV.shift end -unless ARGV.length == 1 +if ARGV.length != 1 puts usage exit 1 end