Module: Homebrew::Unlink Private
- Defined in:
- unlink.rb
Overview
This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.
Provides helper methods for unlinking formulae and kegs with consistent output.
Class Method Summary collapse
- .unlink(keg, dry_run: false, verbose: false) ⇒ void private
- .unlink_versioned_formulae(formula, verbose: false) ⇒ void private
Class Method Details
.unlink(keg, dry_run: false, verbose: false) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
This method returns an undefined value.
20 21 22 23 24 25 26 27 28 |
# File 'unlink.rb', line 20 def self.unlink(keg, dry_run: false, verbose: false) = { dry_run:, verbose: } keg.lock do print "Unlinking #{keg}... " puts if verbose puts "#{keg.unlink(**)} symlinks removed." end end |
.unlink_versioned_formulae(formula, verbose: false) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
This method returns an undefined value.
8 9 10 11 12 13 14 15 16 17 |
# File 'unlink.rb', line 8 def self.unlink_versioned_formulae(formula, verbose: false) formula.versioned_formulae .select(&:keg_only?) .select(&:linked?) .filter_map(&:any_installed_keg) .select(&:directory?) .each do |keg| unlink(keg, verbose:) end end |