Merge pull request #12615 from carlocab/on-os
Revert "remove on_os from formula"
This commit is contained in:
		
						commit
						d3474d03e7
					
				@ -64,6 +64,7 @@ class Formula
 | 
				
			|||||||
  include Utils::Shebang
 | 
					  include Utils::Shebang
 | 
				
			||||||
  include Utils::Shell
 | 
					  include Utils::Shell
 | 
				
			||||||
  include Context
 | 
					  include Context
 | 
				
			||||||
 | 
					  include OnOS # TODO: 3.3.0: deprecate OnOS usage in instance methods.
 | 
				
			||||||
  extend Enumerable
 | 
					  extend Enumerable
 | 
				
			||||||
  extend Forwardable
 | 
					  extend Forwardable
 | 
				
			||||||
  extend Cachable
 | 
					  extend Cachable
 | 
				
			||||||
@ -3064,7 +3065,7 @@ class Formula
 | 
				
			|||||||
      block ||= case only_if
 | 
					      block ||= case only_if
 | 
				
			||||||
      when :clt_installed
 | 
					      when :clt_installed
 | 
				
			||||||
        lambda do |_|
 | 
					        lambda do |_|
 | 
				
			||||||
          if OS.mac? || Homebrew::EnvConfig.simulate_macos_on_linux?
 | 
					          on_macos do
 | 
				
			||||||
            T.cast(self, PourBottleCheck).reason(+<<~EOS)
 | 
					            T.cast(self, PourBottleCheck).reason(+<<~EOS)
 | 
				
			||||||
              The bottle needs the Apple Command Line Tools to be installed.
 | 
					              The bottle needs the Apple Command Line Tools to be installed.
 | 
				
			||||||
                You can install them, if desired, with:
 | 
					                You can install them, if desired, with:
 | 
				
			||||||
 | 
				
			|||||||
@ -1542,8 +1542,12 @@ describe Formula do
 | 
				
			|||||||
        attr_reader :test
 | 
					        attr_reader :test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        def install
 | 
					        def install
 | 
				
			||||||
          @test = 1 if OS.mac? || Homebrew::EnvConfig.simulate_macos_on_linux?
 | 
					          on_macos do
 | 
				
			||||||
          @test = 2 if OS.linux?
 | 
					            @test = 1
 | 
				
			||||||
 | 
					          end
 | 
				
			||||||
 | 
					          on_linux do
 | 
				
			||||||
 | 
					            @test = 2
 | 
				
			||||||
 | 
					          end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
      end.new
 | 
					      end.new
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@ -1561,8 +1565,12 @@ describe Formula do
 | 
				
			|||||||
        attr_reader :test
 | 
					        attr_reader :test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        def install
 | 
					        def install
 | 
				
			||||||
          @test = 1 if OS.mac? || Homebrew::EnvConfig.simulate_macos_on_linux?
 | 
					          on_macos do
 | 
				
			||||||
          @test = 2 if OS.linux?
 | 
					            @test = 1
 | 
				
			||||||
 | 
					          end
 | 
				
			||||||
 | 
					          on_linux do
 | 
				
			||||||
 | 
					            @test = 2
 | 
				
			||||||
 | 
					          end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
      end.new
 | 
					      end.new
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user