diff options
| author | Adam Vandenberg | 2010-08-07 22:15:29 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-08-07 22:15:29 -0700 |
| commit | e2f0e1a26f31f494ec6b972d0e525b3cf9a6d3c9 (patch) | |
| tree | 1b22091ed329a4172a3169876d3ceb428eadd9d8 | |
| parent | 612af6b4fe763346614316f8d7e3b5b1bc69cfda (diff) | |
| download | brew-e2f0e1a26f31f494ec6b972d0e525b3cf9a6d3c9.tar.bz2 | |
Resolve aliases in 'brew edit'.
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 12 | ||||
| -rwxr-xr-x | bin/brew | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index d39df7d7f..61268fda3 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -102,12 +102,6 @@ module HomebrewArgvExtension EOS end - private - - def downcased_unique_named - @downcased_unique_named ||= named.map(&:downcase).uniq - end - def resolve_alias name aka = HOMEBREW_REPOSITORY+"Library/Aliases/#{name}" if aka.file? @@ -116,4 +110,10 @@ module HomebrewArgvExtension name end end + + private + + def downcased_unique_named + @downcased_unique_named ||= named.map(&:downcase).uniq + end end @@ -152,9 +152,10 @@ begin "#{HOMEBREW_REPOSITORY}/bin/brew"<< "#{HOMEBREW_REPOSITORY}/README.md" else - # we don't use ARGV.formulae as that will throw if the file doesn't parse + # Don't use ARGV.formulae as that will throw if the file doesn't parse paths = ARGV.named.collect do |name| - unless File.exist? path = "#{HOMEBREW_REPOSITORY}/Library/Formula/#{name}.rb" + path = "#{HOMEBREW_REPOSITORY}/Library/Formula/#{ARGV.resolve_alias(name)}.rb" + unless File.exist? path require 'formula' raise FormulaUnavailableError, name else |
