1#!/usr/bin/ruby 2 3require "find" 4 5$verbose = ARGV.include?("--verbose"); 6$remove_console_asserts_path = File.expand_path File.join(File.dirname(__FILE__), "remove-console-asserts.pl") 7$web_inspector_user_interface_path = File.expand_path File.join(File.dirname(__FILE__), "..", "UserInterface") 8 9Find.find($web_inspector_user_interface_path) do |path| 10 # Skip directories, External, Images, and non-js. 11 next if File.directory?(path) 12 next if path =~ /\/(External|Images)\// 13 next if path !~ /\.js$/ 14 15 # Run remove-console-asserts on each file. 16 puts "Checking: #{path} ..." if $verbose 17 output = %x{ perl '#{$remove_console_asserts_path}' --input-script '#{path}' --output-script /dev/null } 18 if !output.empty? 19 puts "#{File.basename(path)}:" 20 puts output 21 puts 22 end 23end 24