Sha256: 03e3466cb3c03d60106f92ff61e352cc4871c9fc4c35d7bd57d699cd8ff4d6cf
Contents?: true
Size: 995 Bytes
Versions: 28
Compression:
Stored size: 995 Bytes
Contents
# encoding: utf-8 require 'tempfile' stderr_file = Tempfile.new "ahn#{rand}.stderr" warnings_filename = "tmp/ahnwarnings#{rand}.txt" $stderr.reopen stderr_file.path current_dir = Dir.pwd at_exit do begin stderr_file.rewind lines = stderr_file.read.split("\n").uniq stderr_file.close! ahn_warnings, other_warnings = lines.partition { |line| line.include?(current_dir) && !line.include?('vendor') && line.include?('warning') } if ahn_warnings.any? puts puts "-" * 30 + " AHN Warnings: " + "-" * 30 puts puts ahn_warnings.join("\n") puts puts "-" * 75 puts end if other_warnings.any? File.open(warnings_filename, 'w') { |f| f.write other_warnings.join("\n") } puts puts "Non-AHN warnings written to #{warnings_filename}" puts end exit 1 if ahn_warnings.any? # fail the build... rescue => e puts "Warning capture failed." puts e.message puts e.backtrace.join("\n") end end
Version data entries
28 entries across 28 versions & 1 rubygems