Skip to content

Instantly share code, notes, and snippets.

@mcmoyer
Created November 11, 2010 04:01
Show Gist options
  • Save mcmoyer/671983 to your computer and use it in GitHub Desktop.
Save mcmoyer/671983 to your computer and use it in GitHub Desktop.
use inside web site to find references to files that aren't correctly cased.
#!/usr/bin/ruby
files = Dir['**/**'].sort
files.each do |file|
#do a case insensitve search first
all_matches = `ack -lic "#{file}"`.split("\n")
puts "found #{all_matches.length} matches for #{file}"
exact_matches = `ack -lc "#{file}"`.split("\n")
difference = all_matches - exact_matches
unless difference.empty?
puts "#{difference.join("\n")}\n\n-----------------------------------------"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment