Skip to content

Instantly share code, notes, and snippets.

@jzajpt
Created September 26, 2009 09:01
Show Gist options
  • Save jzajpt/194132 to your computer and use it in GitHub Desktop.
Save jzajpt/194132 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby -wKU
files = Dir["app/stylesheets/**/*"]
files.each do |file_name|
next unless File.file?(file_name)
puts "- reading file #{file_name}"
content = open(file_name).read
tokens = content.scan(/(url\(.+\))/i)
tokens.flatten.each do |token|
path = token.match(/\(['"]?([\w \.\/_-]+)['"]?\)/)
next unless path
unless File.file?("public/#{path[1]}")
puts "#{path[1]} does not exist"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment