diff options
| author | Jack Nagel | 2014-08-29 19:38:32 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-08-29 19:38:32 -0500 |
| commit | 977ae5f27d6d754a2417821ad53248f06add770b (patch) | |
| tree | 1f4279dbfc99bcb67e1a89591b8c26a80825613f /Library | |
| parent | 750d7bb2c81a58f277fa6813a7286ed68b345ebd (diff) | |
| download | brew-977ae5f27d6d754a2417821ad53248f06add770b.tar.bz2 | |
Collapse iteration to a map
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/options.rb | 11 |
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) |
