In 'readall.rb', replaced multi-step 'each' loop with one-line method chain of Ruby enumerator methods
This commit is contained in:
parent
56458f03fc
commit
9ef82ae1e2
@ -13,16 +13,8 @@ module Homebrew
|
|||||||
|
|
||||||
def readall
|
def readall
|
||||||
if ARGV.include?("--syntax")
|
if ARGV.include?("--syntax")
|
||||||
ruby_files = []
|
scan_files = "#{HOMEBREW_LIBRARY}/Homebrew/**/*.rb"
|
||||||
scan_files = %W[
|
ruby_files = Dir.glob(scan_files).reject{|file| file =~ /vendor|cask/ }
|
||||||
#{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
|
|
||||||
|
|
||||||
Homebrew.failed = true unless Readall.valid_ruby_syntax?(ruby_files)
|
Homebrew.failed = true unless Readall.valid_ruby_syntax?(ruby_files)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user