From 68f6936070808c23e6a1e6699defa6a23cebbb82 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 14 Dec 2013 09:35:58 -0600 Subject: [PATCH] Move Pathname#dynamically_linked_libraries to mach module --- Library/Homebrew/extend/pathname.rb | 11 ----------- Library/Homebrew/mach.rb | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 6a43974432..afb60610b4 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -411,17 +411,6 @@ class Pathname end end - # Returns an array containing all dynamically-linked libraries, based on the - # output of otool. This returns the install names, so these are not guaranteed - # to be absolute paths. - # Returns an empty array both for software that links against no libraries, - # and for non-mach objects. - def dynamically_linked_libraries - `#{MacOS.locate("otool")} -L "#{expand_path}"`.chomp.split("\n")[1..-1].map do |line| - line[/\t(.+) \([^(]+\)/, 1] - end - end - def abv out='' n=`find #{to_s} -type f ! -name .DS_Store | wc -l`.to_i diff --git a/Library/Homebrew/mach.rb b/Library/Homebrew/mach.rb index 6729e36fca..e943bd134d 100644 --- a/Library/Homebrew/mach.rb +++ b/Library/Homebrew/mach.rb @@ -141,4 +141,15 @@ module MachO def mach_o_bundle? mach_data.any? { |m| m.fetch(:type) == :bundle } end + + # Returns an array containing all dynamically-linked libraries, based on the + # output of otool. This returns the install names, so these are not guaranteed + # to be absolute paths. + # Returns an empty array both for software that links against no libraries, + # and for non-mach objects. + def dynamically_linked_libraries + `#{MacOS.locate("otool")} -L "#{expand_path}"`.chomp.split("\n")[1..-1].map do |line| + line[/\t(.+) \([^(]+\)/, 1] + end + end end