Module: OnOS

Included in:
Formula, Formula, PourBottleCheck, Resource, SoftwareSpec
Defined in:
extend/os/mac/on_os.rb,
extend/os/linux/on_os.rb,
extend/on_os.rb

Instance Method Summary collapse

Instance Method Details

#on_linux(&block) ⇒ Object

Block only executed on Linux. No-op on macOS.

on_linux do
# Do something Linux-specific
end


17
18
19
20
21
# File 'extend/on_os.rb', line 17

def on_linux(&block)
  raise "No block content defined for 'on_linux' block" unless block

  yield
end

#on_macos(&block) ⇒ Object

Block only executed on macOS. No-op on Linux.

on_macos do
# Do something Mac-specific
end


9
10
11
12
13
# File 'extend/on_os.rb', line 9

def on_macos(&block)
  raise "No block content defined for 'on_macos' block" unless block

  yield
end