mirror of
https://github.com/gosticks/brew.git
synced 2026-10-05 23:16:55 +00:00
blacklist: port to generic layer.
This commit is contained in:
@@ -28,16 +28,6 @@ def blacklisted?(name)
|
||||
EOS
|
||||
when /(lib)?lzma/
|
||||
"lzma is now part of the xz formula."
|
||||
when "xcode"
|
||||
if MacOS.version >= :lion
|
||||
<<-EOS.undent
|
||||
Xcode can be installed from the App Store.
|
||||
EOS
|
||||
else
|
||||
<<-EOS.undent
|
||||
Xcode can be installed from https://developer.apple.com/xcode/downloads/
|
||||
EOS
|
||||
end
|
||||
when "gtest", "googletest", "google-test" then <<-EOS.undent
|
||||
Installing gtest system-wide is not recommended; it should be vendored
|
||||
in your projects that use it.
|
||||
@@ -97,3 +87,6 @@ def blacklisted?(name)
|
||||
EOS
|
||||
end
|
||||
end
|
||||
alias generic_blacklisted? blacklisted?
|
||||
|
||||
require "extend/os/blacklist"
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
require "blacklist"
|
||||
|
||||
if OS.mac?
|
||||
require "extend/os/mac/blacklist"
|
||||
end
|
||||
@@ -0,0 +1,16 @@
|
||||
def blacklisted?(name)
|
||||
case name.downcase
|
||||
when "xcode"
|
||||
if MacOS.version >= :lion
|
||||
<<-EOS.undent
|
||||
Xcode can be installed from the App Store.
|
||||
EOS
|
||||
else
|
||||
<<-EOS.undent
|
||||
Xcode can be installed from https://developer.apple.com/xcode/downloads/
|
||||
EOS
|
||||
end
|
||||
else
|
||||
generic_blacklisted?(name)
|
||||
end
|
||||
end
|
||||
@@ -30,10 +30,6 @@ class BlacklistTests < Homebrew::TestCase
|
||||
%w[lzma liblzma].each { |s| assert_blacklisted s }
|
||||
end
|
||||
|
||||
def test_xcode
|
||||
%w[xcode Xcode].each { |s| assert_blacklisted s }
|
||||
end
|
||||
|
||||
def test_gtest
|
||||
%w[gtest googletest google-test].each { |s| assert_blacklisted s }
|
||||
end
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
require "testing_env"
|
||||
require "blacklist"
|
||||
|
||||
class BlacklistTests < Homebrew::TestCase
|
||||
def assert_blacklisted(s)
|
||||
assert blacklisted?(s), "'#{s}' should be blacklisted"
|
||||
end
|
||||
|
||||
def test_xcode
|
||||
%w[xcode Xcode].each { |s| assert_blacklisted s }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user