Module: OS::Mac::Readall Private
- Extended by:
- T::Helpers
- Defined in:
- extend/os/mac/readall.rb
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.
Instance Method Summary collapse
Instance Method Details
#valid_casks?(tap, os_name: nil, arch: ::Hardware::CPU.type) ⇒ Boolean
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.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'extend/os/mac/readall.rb', line 12 def valid_casks?(tap, os_name: nil, arch: ::Hardware::CPU.type) return true if os_name == :linux current_macos_version = if os_name.is_a?(Symbol) MacOSVersion.from_symbol(os_name) else MacOS.version end success = T.let(true, T::Boolean) tap.cask_files.each do |file| cask = Cask::CaskLoader.load(file) # Fine to have missing URLs for unsupported macOS macos_req = cask.depends_on.macos next if macos_req&.version && Array(macos_req.version).none? do |macos_version| current_macos_version.compare(macos_req.comparator, macos_version) end raise "Missing URL" if cask.url.nil? rescue Interrupt raise rescue Exception => e # rubocop:disable Lint/RescueException os_and_arch = "macOS #{current_macos_version} on #{arch}" onoe "Invalid cask (#{os_and_arch}): #{file}" $stderr.puts e success = false end success end |