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
commit977ae5f27d6d754a2417821ad53248f06add770b (patch)
tree1f4279dbfc99bcb67e1a89591b8c26a80825613f /Library
parent750d7bb2c81a58f277fa6813a7286ed68b345ebd (diff)
downloadbrew-977ae5f27d6d754a2417821ad53248f06add770b.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)