aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/software_spec.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/software_spec.rb
parent5ec396ed38ce9b48108715376c7ff38d7ad48cf9 (diff)
downloadbrew-b5032ad2cbbdcc1917f1c7ca463565ee6a1e0c66.tar.bz2
Formula: add bottle disable DSL
Diffstat (limited to 'Library/Homebrew/software_spec.rb')
-rw-r--r--Library/Homebrew/software_spec.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index e8148322e..d2c811b69 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -63,13 +63,29 @@ class SoftwareSpec
dependency_collector.add(@resource)
end
+ def bottle_unneeded?
+ !!@bottle_disable_reason && @bottle_disable_reason.unneeded?
+ end
+
+ def bottle_disabled?
+ !!@bottle_disable_reason
+ end
+
+ def bottle_disable_reason
+ @bottle_disable_reason
+ end
+
def bottled?
bottle_specification.tag?(bottle_tag) && \
(bottle_specification.compatible_cellar? || ARGV.force_bottle?)
end
- def bottle(&block)
- bottle_specification.instance_eval(&block)
+ def bottle(disable_type = nil, disable_reason = nil, &block)
+ if disable_type
+ @bottle_disable_reason = BottleDisableReason.new(disable_type, disable_reason)
+ else
+ bottle_specification.instance_eval(&block)
+ end
end
def resource_defined?(name)