Skip to content
Snippets Groups Projects
Commit ed28ed78 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #3304 from richiethomas/refactor_uses

In 'readall.rb', replaced multi-step 'each' loop with one-line method chain of Ruby enumerator methods
parents 76cd7c79 43cbf080
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@ module Homebrew
filtered_list
elsif ARGV.named.empty?
if ARGV.include? "--full-name"
full_names = Formula.installed.map(&:full_name).sort &tap_and_name_comparison
full_names = Formula.installed.map(&:full_name).sort(&tap_and_name_comparison)
return if full_names.empty?
puts Formatter.columns(full_names)
else
......
......@@ -14,16 +14,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_PATH}/**/*.rb"
ruby_files = Dir.glob(scan_files).reject { |file| file =~ %r{/(vendor|cask)/} }
Homebrew.failed = true unless Readall.valid_ruby_syntax?(ruby_files)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment