Permalink
Browse files

Dunno

  • Loading branch information...
1 parent 6b3f20d commit 0f11a35b959c3f2540480929cff522a657592b99 @mxcl mxcl committed Mar 11, 2010
Showing with 11 additions and 13 deletions.
  1. +11 −13 Library/Homebrew/extend/ARGV.rb
@@ -2,15 +2,6 @@ class UsageError <RuntimeError; end
class FormulaUnspecifiedError <UsageError; end
class KegUnspecifiedError <UsageError; end
-def resolve_alias name
- aka = HOMEBREW_REPOSITORY+"Library/Aliases/#{name}"
- if aka.file?
- aka.realpath.basename('.rb').to_s
- else
- name
- end
-end
-
module HomebrewArgvExtension
def named
@named ||= reject{|arg| arg[0..0] == '-'}
@@ -22,9 +13,7 @@ def options
def formulae
require 'formula'
- @formulae ||= downcased_unique_named.collect do |name|
- Formula.factory(resolve_alias(name))
- end
+ @formulae ||= downcased_unique_named.map{ |name| Formula.factory(resolve_alias(name)) }
raise FormulaUnspecifiedError if @formulae.empty?
@formulae
end
@@ -110,6 +99,15 @@ def usage; <<-EOS.undent
private
def downcased_unique_named
- @downcased_unique_named ||= named.collect{|arg| arg.downcase}.uniq
+ @downcased_unique_named ||= named.map(&:downcase).uniq
+ end
+
+ def resolve_alias name
+ aka = HOMEBREW_REPOSITORY+"Library/Aliases/#{name}"
+ if aka.file?
+ aka.realpath.basename('.rb').to_s
+ else
+ name
+ end
end
end

0 comments on commit 0f11a35

Please sign in to comment.