From 1d70c28178f318451c888c6278f641262c9cd109 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Thu, 6 May 2021 11:52:18 +0100 Subject: [PATCH] keg_relocate: style improvements Co-authored-by: Mike McQuaid --- Library/Homebrew/extend/os/mac/keg_relocate.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index f7be065782..50a65f4d78 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -38,10 +38,10 @@ class Keg if ENV["HOMEBREW_RELOCATE_RPATHS"] each_rpath_for(file) do |old_name| - if old_name.start_with? relocation.old_cellar - new_name = old_name.sub(relocation.old_cellar, relocation.new_cellar) + new_name = if old_name.start_with? relocation.old_cellar + old_name.sub(relocation.old_cellar, relocation.new_cellar) elsif old_name.start_with? relocation.old_prefix - new_name = old_name.sub(relocation.old_prefix, relocation.new_prefix) + old_name.sub(relocation.old_prefix, relocation.new_prefix) end change_rpath(old_name, new_name, file) if new_name @@ -125,7 +125,7 @@ class Keg def each_rpath_for(file, &block) rpaths = file.rpaths - rpaths.reject! { |fn| fn =~ /^@(loader|executable)_path/ } + .reject { |fn| fn =~ /^@(loader|executable)_path/ } rpaths.each(&block) end