Move Pathname#dynamically_linked_libraries to mach module

This commit is contained in:
Jack Nagel 2013-12-14 09:35:58 -06:00
parent f458fa9e9a
commit 68f6936070
2 changed files with 11 additions and 11 deletions

View File

@ -411,17 +411,6 @@ class Pathname
end end
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 def abv
out='' out=''
n=`find #{to_s} -type f ! -name .DS_Store | wc -l`.to_i n=`find #{to_s} -type f ! -name .DS_Store | wc -l`.to_i

View File

@ -141,4 +141,15 @@ module MachO
def mach_o_bundle? def mach_o_bundle?
mach_data.any? { |m| m.fetch(:type) == :bundle } mach_data.any? { |m| m.fetch(:type) == :bundle }
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
end end