aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorMike McQuaid2017-03-18 17:02:08 +0200
committerMike McQuaid2017-03-20 18:20:31 +0200
commit80e95b684e7485b5c5b7f7209dd95b0bdc9e3406 (patch)
tree421290914f160363cf4333477eee6b3efbdfc982 /Library/Homebrew/extend
parent623c95b3f8660d5c77936483ec9b9a4db16aff00 (diff)
downloadbrew-80e95b684e7485b5c5b7f7209dd95b0bdc9e3406.tar.bz2
blacklist: move to missing_formula class instead.
This will allow extending this class so it can be used by more than just blacklisting.
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/os/blacklist.rb2
-rw-r--r--Library/Homebrew/extend/os/mac/blacklist.rb16
-rw-r--r--Library/Homebrew/extend/os/mac/missing_formula.rb22
-rw-r--r--Library/Homebrew/extend/os/missing_formula.rb2
4 files changed, 24 insertions, 18 deletions
diff --git a/Library/Homebrew/extend/os/blacklist.rb b/Library/Homebrew/extend/os/blacklist.rb
deleted file mode 100644
index 932040f82..000000000
--- a/Library/Homebrew/extend/os/blacklist.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-require "blacklist"
-require "extend/os/mac/blacklist" if OS.mac?
diff --git a/Library/Homebrew/extend/os/mac/blacklist.rb b/Library/Homebrew/extend/os/mac/blacklist.rb
deleted file mode 100644
index edff4697e..000000000
--- a/Library/Homebrew/extend/os/mac/blacklist.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-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
diff --git a/Library/Homebrew/extend/os/mac/missing_formula.rb b/Library/Homebrew/extend/os/mac/missing_formula.rb
new file mode 100644
index 000000000..48dfd2865
--- /dev/null
+++ b/Library/Homebrew/extend/os/mac/missing_formula.rb
@@ -0,0 +1,22 @@
+module Homebrew
+ module MissingFormula
+ class << self
+ def blacklisted_reason(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 #{Formatter.url("https://developer.apple.com/xcode/downloads/")}.
+ EOS
+ end
+ else
+ generic_blacklisted_reason(name)
+ end
+ end
+ end
+ end
+end
diff --git a/Library/Homebrew/extend/os/missing_formula.rb b/Library/Homebrew/extend/os/missing_formula.rb
new file mode 100644
index 000000000..02c59f4e4
--- /dev/null
+++ b/Library/Homebrew/extend/os/missing_formula.rb
@@ -0,0 +1,2 @@
+require "missing_formula"
+require "extend/os/mac/missing_formula" if OS.mac?