aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula_support.rb
diff options
context:
space:
mode:
authorJack Nagel2012-08-12 13:37:40 -0500
committerJack Nagel2012-08-12 13:37:40 -0500
commit8952bcf315e19c60966b483fef80a69d31ca2c1e (patch)
tree851e7038fe5e45f77291dc5c8177f3b6950c8414 /Library/Homebrew/formula_support.rb
parent33ec48a3946c78c392d71a2b631414710f8beb8b (diff)
downloadbrew-8952bcf315e19c60966b483fef80a69d31ca2c1e.tar.bz2
Fix writing build options to install receipt
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/formula_support.rb')
-rw-r--r--Library/Homebrew/formula_support.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb
index 4c2a5e8ec..c0b920b2c 100644
--- a/Library/Homebrew/formula_support.rb
+++ b/Library/Homebrew/formula_support.rb
@@ -156,6 +156,7 @@ end
# This class holds the build-time options defined for a Formula,
# and provides named access to those options during install.
class BuildOptions
+ include Enumerable
def initialize args
# Take a copy of the args (any string array, actually)
@@ -181,19 +182,15 @@ class BuildOptions
end
def has_option? name
- @options.any? {|o| o[0] == name}
+ @options.any? { |opt, _| opt == name }
end
def empty?
@options.empty?
end
- def collect
- @options.collect {|o| yield o[0], o[1]}
- end
-
def each
- @options.each {|o| yield o[0], o[1]}
+ @options.each { |opt, desc| yield opt, desc }
end
def include? name