Skip to content

Commit

Permalink
macho_file: fix up YARD docs (#559)
Browse files Browse the repository at this point in the history
- add examples showing usage of `:uniq` and `:last`
- fix documentation for `:last`, since the second line was being
  rendered as documentation for the `#delete_rpath` method instead of
  for the option.
  • Loading branch information
carlocab authored Jul 26, 2023
1 parent 2bcb913 commit e4a19cc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/macho/macho_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,17 +411,23 @@ def add_rpath(path, _options = {})

# Delete the given runtime path from the Mach-O.
# @example
# file.rpaths # => ["/lib"]
# file.delete_rpath("/lib")
# file.rpaths # => []
# file1.rpaths # => ["/lib", "/usr/lib", "/lib"]
# file1.delete_rpath("/lib")
# file1.rpaths # => ["/usr/lib", "/lib"]
# file2.rpaths # => ["foo", "foo"]
# file2.delete_rpath("foo", :uniq => true)
# file2.rpaths # => []
# file3.rpaths # => ["foo", "bar", "foo"]
# file3.delete_rpath("foo", :last => true)
# file3.rpaths # => ["foo", "bar"]
# @param path [String] the runtime path to delete
# @param options [Hash]
# @option options [Boolean] :uniq (false) if true, also delete
# duplicates of the requested path. If false, delete the first
# instance (by offset) of the requested path, unless :last is true.
# Incompatible with :last.
# @option options [Boolean] :last (false) if true, delete the last
# instance (by offset) of the requested path. Incompatible with :uniq.
# instance (by offset) of the requested path. Incompatible with :uniq.
# @return void
# @raise [RpathUnknownError] if no such runtime path exists
# @raise [ArgumentError] if both :uniq and :last are true
Expand Down

0 comments on commit e4a19cc

Please sign in to comment.