Module: OnSystem::MacOSAndLinux Private
- Includes:
- DSL
- Included in:
- Cask::DSL, Formula, Formula, Homebrew::Service, PourBottleCheck, Resource, SoftwareSpec
- Defined in:
- on_system.rbi,
on_system/dsl.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 Attribute Summary
Attributes included from DSL
Instance Method Summary collapse
- #on_macos(&block) ⇒ T.type_parameter(:U)? private
- #on_system(linux, macos:, &block) ⇒ T.type_parameter(:U)? private
- #on_system_conditional(macos: nil, linux: nil) ⇒ T.type_parameter(:U)? private
Methods included from DSL
#on_arch_conditional, #on_os_blocks_exist?, #on_system_blocks_exist?
Instance Method Details
#on_macos(&block) ⇒ T.type_parameter(:U)?
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.
9 |
# File 'on_system.rbi', line 9 def on_macos(&block); end |
#on_system(linux, macos:, &block) ⇒ T.type_parameter(:U)?
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.
120 121 122 123 124 125 126 127 128 129 |
# File 'on_system/dsl.rb', line 120 def on_system(linux, macos:, &block) mark_on_system_block(os: true) raise ArgumentError, "The first argument to `on_system` must be `:linux`" if linux != :linux os_version, _, or_condition = macos.to_s.partition(/_(?=or_)/) return if !OnSystem.os_condition_met?(os_version.to_sym, or_condition.presence&.to_sym) && !OnSystem.os_condition_met?(:linux) with_on_system_block(:os, &block) end |
#on_system_conditional(macos: nil, linux: nil) ⇒ T.type_parameter(:U)?
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.
137 138 139 140 141 142 143 144 |
# File 'on_system/dsl.rb', line 137 def on_system_conditional(macos: nil, linux: nil) mark_on_system_block if OnSystem.os_condition_met?(:macos) && macos.present? macos elsif OnSystem.os_condition_met?(:linux) && linux.present? linux end end |