mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
26 lines
582 B
Ruby
26 lines
582 B
Ruby
# typed: false
|
|
# frozen_string_literal: true
|
|
|
|
require "requirement"
|
|
|
|
# A requirement on TunTap for macOS.
|
|
#
|
|
# @api private
|
|
class TuntapRequirement < Requirement
|
|
extend T::Sig
|
|
|
|
fatal true
|
|
cask "tuntap"
|
|
satisfy(build_env: false) { self.class.binary_tuntap_installed? }
|
|
|
|
sig { returns(T::Boolean) }
|
|
def self.binary_tuntap_installed?
|
|
%w[
|
|
/Library/Extensions/tun.kext
|
|
/Library/Extensions/tap.kext
|
|
/Library/LaunchDaemons/net.sf.tuntaposx.tun.plist
|
|
/Library/LaunchDaemons/net.sf.tuntaposx.tap.plist
|
|
].all? { |file| File.exist?(file) }
|
|
end
|
|
end
|