From fc7462acd5ffb7cc393d2b56b989e96112ade896 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Mon, 20 Dec 2021 23:06:42 +0900 Subject: [PATCH] remove on_os from formula --- Library/Homebrew/formula.rb | 3 +-- Library/Homebrew/test/formula_spec.rb | 16 ++++------------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 32e62090d4..8f9cc93c4f 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -64,7 +64,6 @@ class Formula include Utils::Shebang include Utils::Shell include Context - include OnOS # TODO: 3.3.0: deprecate OnOS usage in instance methods. extend Enumerable extend Forwardable extend Cachable @@ -3065,7 +3064,7 @@ class Formula block ||= case only_if when :clt_installed lambda do |_| - on_macos do + if OS.mac? || Homebrew::EnvConfig.simulate_macos_on_linux? T.cast(self, PourBottleCheck).reason(+<<~EOS) The bottle needs the Apple Command Line Tools to be installed. You can install them, if desired, with: diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index 8f31f76d62..7d381fc4d1 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -1542,12 +1542,8 @@ describe Formula do attr_reader :test def install - on_macos do - @test = 1 - end - on_linux do - @test = 2 - end + @test = 1 if OS.mac? || Homebrew::EnvConfig.simulate_macos_on_linux? + @test = 2 if OS.linux? end end.new end @@ -1565,12 +1561,8 @@ describe Formula do attr_reader :test def install - on_macos do - @test = 1 - end - on_linux do - @test = 2 - end + @test = 1 if OS.mac? || Homebrew::EnvConfig.simulate_macos_on_linux? + @test = 2 if OS.linux? end end.new end