A quick script that uses Nokogiri and my own fork of the CssParser Gem to search your static HTML/CSS for un-used images and delete them.
Still very much beta.
-d Directory you want to check (default is www
)
-i Directory where your images are stored (default is img
)
ex: ruby cleaner.rb -d WWW -i img
or if you make it executable and drop in your bin
:
cleaner -d WWW -i img
$ ruby cleaner.rb
That will run through the www
directory in the package and remove any images not being used by .html
or .css
files.
- Write proper tests