diff options
| author | Jack Nagel | 2014-08-29 19:38:32 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-08-29 19:38:32 -0500 |
| commit | b6242778fe2827b3de63f991b3d44a3bee9e790a (patch) | |
| tree | ac6bb4654a82d9422bbbdbda2830a417bdba2f98 /Library | |
| parent | 305e3aa22934a5f91af6eccfbb5dae97a8455fc6 (diff) | |
| download | homebrew-b6242778fe2827b3de63f991b3d44a3bee9e790a.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) |
