aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula_support.rb
diff options
context:
space:
mode:
authorXu Cheng2015-09-14 19:51:04 +0800
committerXu Cheng2015-10-19 21:41:36 +0800
commitb5032ad2cbbdcc1917f1c7ca463565ee6a1e0c66 (patch)
treec79cf3e4d32de22d03f40c34408e9c8535dea44f /Library/Homebrew/formula_support.rb
parent5ec396ed38ce9b48108715376c7ff38d7ad48cf9 (diff)
downloadbrew-b5032ad2cbbdcc1917f1c7ca463565ee6a1e0c66.tar.bz2
Formula: add bottle disable DSL
Diffstat (limited to 'Library/Homebrew/formula_support.rb')
-rw-r--r--Library/Homebrew/formula_support.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb
index 2430c31b0..c76ed39f3 100644
--- a/Library/Homebrew/formula_support.rb
+++ b/Library/Homebrew/formula_support.rb
@@ -55,3 +55,23 @@ EOS
end.strip
end
end
+
+# Used to annotate formulae that don't require compiling or cannot build bottle.
+class BottleDisableReason
+ def initialize(type, reason)
+ @type = type
+ @reason = reason
+ end
+
+ def unneeded?
+ @type == :unneeded
+ end
+
+ def to_s
+ if @type == :unneeded
+ "This formula doesn't require compiling."
+ else
+ @reason
+ end
+ end
+end