From a8c4136e9edb02e6b637b53357af7a921538c149 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Sun, 10 Mar 2019 21:05:51 -0400 Subject: [PATCH] os/mac: Use delegation for Mach-O methods --- Library/Homebrew/os/mac/mach.rb | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index ad3e26ae16..4e7c86e98f 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -2,6 +2,10 @@ require "macho" require "os/mac/architecture_list" module MachOShim + extend Forwardable + + delegate [:dylib_id, :rpaths, :delete_rpath] => :macho + # @private def macho @macho ||= begin @@ -56,18 +60,6 @@ module MachOShim lcs.map(&:name).map(&:to_s).uniq end - def dylib_id - macho.dylib_id - end - - def rpaths - macho.rpaths - end - - def delete_rpath(rpath) - macho.delete_rpath(rpath) - end - def archs mach_data.map { |m| m.fetch :arch }.extend(ArchitectureListExtension) end