diff options
| author | Adam Vandenberg | 2010-07-13 07:31:43 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-08-07 18:08:51 -0700 |
| commit | 0bf7b7525524868b60e826d1df4249ff33933087 (patch) | |
| tree | 2ebc0154b910fa727c3f0446cc8879000cd5b7f8 /Library | |
| parent | f207fd0ef587d76b32e70a02903293c3affc727f (diff) | |
| download | homebrew-0bf7b7525524868b60e826d1df4249ff33933087.tar.bz2 | |
ARGV - rename method that conflicts with optparse
optparse adds an "options" method to ARGV, and so does Homebrew.
Rename this method (and remove optparse blocking script) so that
Homebrew plays nicer with external Ruby software.
This fixes the issue where "gem install thin" would break
"brew server", for instance.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/optparse.rb | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 352f5d03d..d39df7d7f 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -7,7 +7,7 @@ module HomebrewArgvExtension @named ||= reject{|arg| arg[0..0] == '-'} end - def options + def options_only select {|arg| arg[0..0] == '-'} end @@ -59,7 +59,7 @@ module HomebrewArgvExtension end def flag? flag - options.each do |arg| + options_only.each do |arg| return true if arg == flag next if arg[1..1] == '-' return true if arg.include? flag[2..2] diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 622d6575f..c46e20b2b 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -106,7 +106,7 @@ class FormulaInstaller fork do begin read.close - exec '/usr/bin/nice', '/usr/bin/ruby', '-I', File.dirname(__FILE__), '-rinstall', f.path, '--', *ARGV.options + exec '/usr/bin/nice', '/usr/bin/ruby', '-I', File.dirname(__FILE__), '-rinstall', f.path, '--', *ARGV.options_only rescue => e Marshal.dump(e, write) write.close diff --git a/Library/Homebrew/optparse.rb b/Library/Homebrew/optparse.rb deleted file mode 100644 index 67f6641f8..000000000 --- a/Library/Homebrew/optparse.rb +++ /dev/null @@ -1,3 +0,0 @@ -# This file is put here to prevent loading of real optparse.rb, -# which killed Homebrew. Details of issue can be found here: -# http://github.com/mxcl/homebrew/issues#issue/97 |
