def check_all
old_log_impl = PlatformInfo.log_implementation
begin
PlatformInfo.log_implementation = lambda do |message|
message = PlatformInfo.send(:reindent, message, 10)
message.sub!(/^ /, '')
STDOUT.puts " -> #{message}"
end
@missing_dependencies = []
@dep_identifiers.each do |identifier|
dep = Depcheck.find(identifier)
raise "Cannot find depcheck spec #{identifier.inspect}" if !dep
puts_header "Checking for #{dep.name}..."
result = dep.check
result = { :found => false } if !result
if result[:found] && !result[:error]
puts_detail "Found: <green>yes</green>"
else
if result[:error]
puts_detail "Found: #{result[:found] ? "<yellow>yes, but there was an error</yellow>" : "<red>no</red>"}"
puts_detail "Error: <red>#{result[:error]}</red>"
else
puts_detail "Found: #{result[:found] ? "<green>yes</green>" : "<red>no</red>"}"
end
@missing_dependencies << dep
end
result.each_pair do |key, value|
if key.is_a?(String)
puts_detail "#{key}: #{value}"
end
end
end
return @missing_dependencies.empty?
ensure
PlatformInfo.log_implementation = old_log_impl
end
end