README.rdoc in aanand-deadweight-0.0.2 vs README.rdoc in aanand-deadweight-0.0.3
- old
+ new
@@ -1,35 +1,42 @@
= deadweight
Deadweight is RCov for CSS, kind of. Given a set of stylesheets and a set of URLs, it determines which selectors are actually used and reports which can be "safely" deleted.
-Simple example:
+=== A Simple Example
+
# lib/tasks/deadweight.rake
require 'deadweight'
- description "run Deadweight (script/server needs to be running)"
+ desc "run Deadweight (script/server needs to be running)"
task :deadweight do
dw = Deadweight.new
dw.stylesheets = %w( /stylesheets/style.css )
dw.pages = %w( / /page/1 /about )
puts dw.run
end
This will output all unused selectors, one per line.
-Things to note:
+=== How You Install It
+
+ gem sources -a http://gems.github.com
+ sudo gem install aanand-deadweight
+
+=== Things to Note
+
- By default, it looks at http://localhost:3000.
- It's completely dumb about any classes, IDs or tags that are only added by your Javascript layer, but you can filter them out by setting +ignore_selectors+.
- You can optionally tell it to use Mechanize, and set up more complicated targets for scraping by specifying them as Procs.
-More complex example:
+=== A More Complex Example, In Light of All That
# lib/tasks/deadweight.rake
require 'deadweight'
- description "run Deadweight on staging server"
+ desc "run Deadweight on staging server"
task :deadweight do
dw = Deadweight.new
dw.mechanize = true