Revert "Always pass an Options instance to the BuildOptions constructor"
This reverts commit e143bcef259ca76b2124e6e73bd9bdf872418723. Closes Homebrew/homebrew#31557. Closes Homebrew/homebrew#31559. Closes Homebrew/homebrew#31561. Closes Homebrew/homebrew#31562.
This commit is contained in:
		
							parent
							
								
									d4aa7b8df0
								
							
						
					
					
						commit
						9f14262d92
					
				@ -4,7 +4,7 @@ class BuildOptions
 | 
				
			|||||||
  attr_accessor :universal
 | 
					  attr_accessor :universal
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def initialize(args, options)
 | 
					  def initialize(args, options)
 | 
				
			||||||
    @args = args
 | 
					    @args = Options.coerce(args)
 | 
				
			||||||
    @options = options
 | 
					    @options = options
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -34,7 +34,7 @@ class SoftwareSpec
 | 
				
			|||||||
    @bottle_specification = BottleSpecification.new
 | 
					    @bottle_specification = BottleSpecification.new
 | 
				
			||||||
    @patches = []
 | 
					    @patches = []
 | 
				
			||||||
    @options = Options.new
 | 
					    @options = Options.new
 | 
				
			||||||
    @build = BuildOptions.new(Options.coerce(ARGV.options_only), options)
 | 
					    @build = BuildOptions.new(ARGV.options_only, options)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def owner= owner
 | 
					  def owner= owner
 | 
				
			||||||
 | 
				
			|||||||
@ -3,8 +3,10 @@ require 'build_options'
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class BuildOptionsTests < Homebrew::TestCase
 | 
					class BuildOptionsTests < Homebrew::TestCase
 | 
				
			||||||
  def setup
 | 
					  def setup
 | 
				
			||||||
    args = Options.coerce(%w(--with-foo --with-bar --without-qux))
 | 
					    args = %w{--with-foo --with-bar --without-qux}
 | 
				
			||||||
    opts = Options.coerce(%w(--with-foo --with-bar --without-baz --without-qux))
 | 
					    opts = Options.new
 | 
				
			||||||
 | 
					    opts << Option.new("with-foo") << Option.new("with-bar")
 | 
				
			||||||
 | 
					    opts << Option.new("without-baz") << Option.new("without-qux")
 | 
				
			||||||
    @build = BuildOptions.new(args, opts)
 | 
					    @build = BuildOptions.new(args, opts)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user