aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-08-29 19:38:32 -0500
committerJack Nagel2014-08-29 19:38:32 -0500
commitb6242778fe2827b3de63f991b3d44a3bee9e790a (patch)
treeac6bb4654a82d9422bbbdbda2830a417bdba2f98 /Library
parent305e3aa22934a5f91af6eccfbb5dae97a8455fc6 (diff)
downloadhomebrew-b6242778fe2827b3de63f991b3d44a3bee9e790a.tar.bz2
Collapse iteration to a map
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/options.rb11
1 files changed, 1 insertions, 10 deletions
diff --git a/Library/Homebrew/options.rb b/Library/Homebrew/options.rb
index f15af418a..65be6e1f4 100644
--- a/Library/Homebrew/options.rb
+++ b/Library/Homebrew/options.rb
@@ -36,16 +36,7 @@ class Options
include Enumerable
def self.create(array)
- options = new
- array.each do |e|
- case e
- when /^--(.+)$/
- options << Option.new($1)
- else
- options << Option.new(e)
- end
- end
- options
+ new array.map { |e| Option.new(e[/^--(.+)$/, 1] || e) }
end
def initialize(*args)