2010-07-04 09:56:50 -07:00
|
|
|
# `brew readall` tries to import all formulae one-by-one.
|
|
|
|
# This can be useful for debugging issues across all formulae
|
2010-07-18 14:20:54 -07:00
|
|
|
# when making significant changes to formula.rb,
|
|
|
|
# or to determine if any current formulae have Ruby issues
|
2010-07-04 09:56:50 -07:00
|
|
|
|
2016-07-09 13:51:19 +01:00
|
|
|
require "readall"
|
2014-04-13 16:25:46 +01:00
|
|
|
|
2014-04-27 19:45:18 -05:00
|
|
|
module Homebrew
|
|
|
|
def readall
|
2016-07-09 13:51:19 +01:00
|
|
|
if ARGV.include?("--syntax")
|
|
|
|
ruby_files = []
|
2016-04-20 01:22:50 +02:00
|
|
|
scan_files = %W[
|
|
|
|
#{HOMEBREW_LIBRARY}/*.rb
|
|
|
|
#{HOMEBREW_LIBRARY}/Homebrew/**/*.rb
|
|
|
|
]
|
|
|
|
Dir.glob(scan_files).each do |rb|
|
2015-08-03 21:14:20 +08:00
|
|
|
next if rb.include?("/vendor/")
|
2015-03-07 11:55:14 +00:00
|
|
|
ruby_files << rb
|
|
|
|
end
|
|
|
|
|
2016-07-09 13:51:19 +01:00
|
|
|
Homebrew.failed = true unless Readall.valid_ruby_syntax?(ruby_files)
|
2015-03-07 11:55:14 +00:00
|
|
|
end
|
|
|
|
|
2016-07-09 13:51:19 +01:00
|
|
|
options = { :aliases => ARGV.include?("--aliases") }
|
|
|
|
taps = if ARGV.named.any?
|
|
|
|
[Tap.fetch(ARGV.named.first)]
|
2014-04-27 19:45:18 -05:00
|
|
|
else
|
2016-07-09 13:51:19 +01:00
|
|
|
Tap
|
2015-12-19 18:47:20 +08:00
|
|
|
end
|
2016-07-09 13:51:19 +01:00
|
|
|
taps.each do |tap|
|
|
|
|
Homebrew.failed = true unless Readall.valid_tap?(tap, options)
|
2014-04-27 19:45:18 -05:00
|
|
|
end
|
2010-07-18 14:20:54 -07:00
|
|
|
end
|
|
|
|
end
|