diff options
| author | Richie Thomas | 2017-10-11 10:51:19 -0400 |
|---|---|---|
| committer | richiethomas | 2017-10-12 17:38:02 -0400 |
| commit | 9ef82ae1e254088e9232ba7e67afa0da9246bc6c (patch) | |
| tree | 5738d8b0f929ee39fe71930c5ab4c0bfddcf37be /Library/Homebrew | |
| parent | 56458f03fcc68ef6d8ee3ee4a7c1d16021aa5800 (diff) | |
| download | brew-9ef82ae1e254088e9232ba7e67afa0da9246bc6c.tar.bz2 | |
In 'readall.rb', replaced multi-step 'each' loop with one-line method chain of Ruby enumerator methods
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/readall.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/Library/Homebrew/cmd/readall.rb b/Library/Homebrew/cmd/readall.rb index 3591e0c09..0fa1f7c07 100644 --- a/Library/Homebrew/cmd/readall.rb +++ b/Library/Homebrew/cmd/readall.rb @@ -13,16 +13,8 @@ module Homebrew def readall if ARGV.include?("--syntax") - ruby_files = [] - scan_files = %W[ - #{HOMEBREW_LIBRARY}/*.rb - #{HOMEBREW_LIBRARY}/Homebrew/**/*.rb - ] - Dir.glob(scan_files).each do |rb| - next if rb.include?("/vendor/") - next if rb.include?("/cask/") - ruby_files << rb - end + scan_files = "#{HOMEBREW_LIBRARY}/Homebrew/**/*.rb" + ruby_files = Dir.glob(scan_files).reject{|file| file =~ /vendor|cask/ } Homebrew.failed = true unless Readall.valid_ruby_syntax?(ruby_files) end |
