Don't require the WHOLE of Homebrew from ARGV.rb

This was slowing down every instantiation of brew significantly.

Hopefully doesn't break anything that had become accustomed to not having to require 'formula' or 'keg'.

/cc @mikemcquaid
This commit is contained in:
Max Howell 2012-08-11 12:34:39 -04:00
parent 8818e008e3
commit 33ec48a394

View File

@ -1,5 +1,3 @@
require 'bottles'
module HomebrewArgvExtension module HomebrewArgvExtension
def named def named
@named ||= reject{|arg| arg[0..0] == '-'} @named ||= reject{|arg| arg[0..0] == '-'}
@ -115,10 +113,12 @@ module HomebrewArgvExtension
end end
def build_bottle? def build_bottle?
require 'bottles'
bottles_supported? and include? '--build-bottle' bottles_supported? and include? '--build-bottle'
end end
def build_from_source? def build_from_source?
require 'bottles'
flag? '--build-from-source' or ENV['HOMEBREW_BUILD_FROM_SOURCE'] \ flag? '--build-from-source' or ENV['HOMEBREW_BUILD_FROM_SOURCE'] \
or not bottles_supported? or not options_only.empty? or not bottles_supported? or not options_only.empty?
end end