aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-10-09 00:20:15 -0500
committerJack Nagel2014-10-09 00:20:15 -0500
commit285f8f77e6816cb3a0694455813b5cf2dc50e9bd (patch)
tree0b3fc9abd01ccca43618e7ca4b517a2f6d71f3b6 /Library
parent5247f44205920023ce666e38ac5fd3e5c74aef83 (diff)
downloadbrew-285f8f77e6816cb3a0694455813b5cf2dc50e9bd.tar.bz2
Tab#with? accepts the same types as BuildOptions#with?
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/build_options.rb6
-rw-r--r--Library/Homebrew/cmd/leaves.rb2
-rw-r--r--Library/Homebrew/cmd/missing.rb2
-rw-r--r--Library/Homebrew/tab.rb3
4 files changed, 5 insertions, 8 deletions
diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb
index d880c76eb..64ca93173 100644
--- a/Library/Homebrew/build_options.rb
+++ b/Library/Homebrew/build_options.rb
@@ -9,11 +9,7 @@ class BuildOptions
end
def with? val
- if val.respond_to?(:option_name)
- name = val.option_name
- else
- name = val
- end
+ name = val.respond_to?(:option_name) ? val.option_name : val
if option_defined? "with-#{name}"
include? "with-#{name}"
diff --git a/Library/Homebrew/cmd/leaves.rb b/Library/Homebrew/cmd/leaves.rb
index 4b1757ad0..64387342f 100644
--- a/Library/Homebrew/cmd/leaves.rb
+++ b/Library/Homebrew/cmd/leaves.rb
@@ -13,7 +13,7 @@ module Homebrew
f.deps.each do |dep|
if dep.optional? || dep.recommended?
- deps << dep.to_formula.name if tab.with?(dep.to_formula.name)
+ deps << dep.to_formula.name if tab.with?(dep)
else
deps << dep.to_formula.name
end
diff --git a/Library/Homebrew/cmd/missing.rb b/Library/Homebrew/cmd/missing.rb
index 686369912..67d10d11f 100644
--- a/Library/Homebrew/cmd/missing.rb
+++ b/Library/Homebrew/cmd/missing.rb
@@ -8,7 +8,7 @@ module Homebrew
missing_deps = f.recursive_dependencies do |dependent, dep|
if dep.optional? || dep.recommended?
tab = Tab.for_formula(dependent)
- Dependency.prune unless tab.with?(dep.name)
+ Dependency.prune unless tab.with?(dep)
elsif dep.build?
Dependency.prune
end
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index c295fe90e..ea619d57c 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -81,7 +81,8 @@ class Tab < OpenStruct
:compiler => :clang
end
- def with? name
+ def with? val
+ name = val.respond_to?(:option_name) ? val.option_name : val
include?("with-#{name}") || unused_options.include?("without-#{name}")
end