From 9f14262d921bed0cf718bc5a7aded551955673c9 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 13 Aug 2014 08:45:08 +0100 Subject: [PATCH] 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. --- Library/Homebrew/build_options.rb | 2 +- Library/Homebrew/software_spec.rb | 2 +- Library/Homebrew/test/test_build_options.rb | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb index 19169af3d3..f3c7e856e3 100644 --- a/Library/Homebrew/build_options.rb +++ b/Library/Homebrew/build_options.rb @@ -4,7 +4,7 @@ class BuildOptions attr_accessor :universal def initialize(args, options) - @args = args + @args = Options.coerce(args) @options = options end diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index e88975a733..c595a45962 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -34,7 +34,7 @@ class SoftwareSpec @bottle_specification = BottleSpecification.new @patches = [] @options = Options.new - @build = BuildOptions.new(Options.coerce(ARGV.options_only), options) + @build = BuildOptions.new(ARGV.options_only, options) end def owner= owner diff --git a/Library/Homebrew/test/test_build_options.rb b/Library/Homebrew/test/test_build_options.rb index 4ee12974bf..e3ed44f9da 100644 --- a/Library/Homebrew/test/test_build_options.rb +++ b/Library/Homebrew/test/test_build_options.rb @@ -3,8 +3,10 @@ require 'build_options' class BuildOptionsTests < Homebrew::TestCase def setup - args = Options.coerce(%w(--with-foo --with-bar --without-qux)) - opts = Options.coerce(%w(--with-foo --with-bar --without-baz --without-qux)) + args = %w{--with-foo --with-bar --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) end