Module: MachO::Tools
- Defined in:
- lib/macho/tools.rb
Overview
A collection of convenient methods for common operations on Mach-O and Fat binaries.
Class Method Summary collapse
-
.add_rpath(filename, new_path) ⇒ void
Add a runtime path to a Mach-O or Fat binary, overwriting the source file.
-
.change_dylib_id(filename, new_id) ⇒ void
Changes the dylib ID of a Mach-O or Fat binary, overwriting the source file.
-
.change_install_name(filename, old_name, new_name) ⇒ void
Changes a shared library install name in a Mach-O or Fat binary, overwriting the source file.
-
.change_rpath(filename, old_path, new_path) ⇒ void
Changes a runtime path in a Mach-O or Fat binary, overwriting the source file.
-
.delete_rpath(filename, old_path) ⇒ void
Delete a runtime path from a Mach-O or Fat binary, overwriting the source file.
-
.dylibs(filename) ⇒ Array<String>
An array of all dylibs linked to the binary.
Class Method Details
.add_rpath(filename, new_path) ⇒ void
unstub
This method returns an undefined value.
Add a runtime path to a Mach-O or Fat binary, overwriting the source file.
52 53 54 |
# File 'lib/macho/tools.rb', line 52 def self.add_rpath(filename, new_path) raise UnimplementedError.new("adding rpaths to a Mach-O") end |
.change_dylib_id(filename, new_id) ⇒ void
unstub for fat files
This method returns an undefined value.
Changes the dylib ID of a Mach-O or Fat binary, overwriting the source file.
17 18 19 20 21 22 |
# File 'lib/macho/tools.rb', line 17 def self.change_dylib_id(filename, new_id) file = MachO.open(filename) file.dylib_id = new_id file.write! end |
.change_install_name(filename, old_name, new_name) ⇒ void
unstub for fat files
This method returns an undefined value.
Changes a shared library install name in a Mach-O or Fat binary, overwriting the source file.
30 31 32 33 34 35 |
# File 'lib/macho/tools.rb', line 30 def self.change_install_name(filename, old_name, new_name) file = MachO.open(filename) file.change_install_name(old_name, new_name) file.write! end |
.change_rpath(filename, old_path, new_path) ⇒ void
unstub
This method returns an undefined value.
Changes a runtime path in a Mach-O or Fat binary, overwriting the source file.
43 44 45 |
# File 'lib/macho/tools.rb', line 43 def self.change_rpath(filename, old_path, new_path) raise UnimplementedError.new("changing rpaths in a Mach-O") end |
.delete_rpath(filename, old_path) ⇒ void
unstub
This method returns an undefined value.
Delete a runtime path from a Mach-O or Fat binary, overwriting the source file.
61 62 63 |
# File 'lib/macho/tools.rb', line 61 def self.delete_rpath(filename, old_path) raise UnimplementedError.new("removing rpaths from a Mach-O") end |
.dylibs(filename) ⇒ Array<String>
Returns an array of all dylibs linked to the binary.
6 7 8 9 10 |
# File 'lib/macho/tools.rb', line 6 def self.dylibs(filename) file = MachO.open(filename) file.linked_dylibs end |