diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index 93cab7de4f..aef8164268 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -3,19 +3,21 @@ require "macho" require "os/mac/architecture_list" +# {Pathname} extension for dealing with Mach-O files. +# +# @api private module MachOShim extend Forwardable delegate [:dylib_id, :rpaths, :delete_rpath] => :macho - # @private def macho @macho ||= begin MachO.open(to_s) end end + private :macho - # @private def mach_data @mach_data ||= begin machos = [] @@ -55,6 +57,7 @@ module MachOShim [] end end + private :mach_data def dynamically_linked_libraries(except: :none) lcs = macho.dylib_load_commands.reject { |lc| lc.type == except } @@ -94,19 +97,16 @@ module MachOShim arch == :ppc64 end - # @private def dylib? mach_data.any? { |m| m.fetch(:type) == :dylib } end - # @private def mach_o_executable? mach_data.any? { |m| m.fetch(:type) == :executable } end alias binary_executable? mach_o_executable? - # @private def mach_o_bundle? mach_data.any? { |m| m.fetch(:type) == :bundle } end