Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix writing build options to install receipt

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
  • Loading branch information...
commit e532239feadc54ce11fe876709c0a71696552935 1 parent d819b1f
Jack Nagel authored
9  Library/Homebrew/formula_support.rb
@@ -156,6 +156,7 @@ def to_s
156 156
 # This class holds the build-time options defined for a Formula,
157 157
 # and provides named access to those options during install.
158 158
 class BuildOptions
  159
+  include Enumerable
159 160
 
160 161
   def initialize args
161 162
     # Take a copy of the args (any string array, actually)
@@ -181,19 +182,15 @@ def add name, description=nil
181 182
   end
182 183
 
183 184
   def has_option? name
184  
-    @options.any? {|o| o[0] == name}
  185
+    @options.any? { |opt, _| opt == name }
185 186
   end
186 187
 
187 188
   def empty?
188 189
     @options.empty?
189 190
   end
190 191
 
191  
-  def collect
192  
-    @options.collect {|o| yield o[0], o[1]}
193  
-  end
194  
-
195 192
   def each
196  
-    @options.each {|o| yield o[0], o[1]}
  193
+    @options.each { |opt, desc| yield opt, desc }
197 194
   end
198 195
 
199 196
   def include? name
4  Library/Homebrew/tab.rb
@@ -13,7 +13,7 @@ def self.for_install f, args
13 13
     arg_options = args.options_only
14 14
     # Pick off the option flags from the formula's `options` array by
15 15
     # discarding the descriptions.
16  
-    formula_options = f.options.map { |o, _| o }
  16
+    formula_options = f.build.map { |opt, _| "--#{opt}" }
17 17
 
18 18
     Tab.new :used_options => formula_options & arg_options,
19 19
             :unused_options => formula_options - arg_options,
@@ -67,7 +67,7 @@ def self.for_formula f
67 67
 
68 68
   def self.dummy_tab f
69 69
     Tab.new :used_options => [],
70  
-            :unused_options => f.options.map { |o, _| o},
  70
+            :unused_options => f.build.map { |opt, _| "--#{opt}" },
71 71
             :built_bottle => false,
72 72
             :tapped_from => ""
73 73
   end

0 notes on commit e532239

Please sign in to comment.
Something went wrong with that request. Please try again.