View on GitHub

access_lint

Check for web accessibility errors via the command line or Ruby.

Download this project as a .zip file Download this project as a tar.gz file

access_lint

Build Status Gem Version Code Climate Coverage Status

Run web accessibility audits on urls or files, from the command line or within Ruby.

About

AccessLint uses the Accessibility Developer Tools javascript library to make assertions on the DOM via PhantomJS. The rules that are applied are listed below.

Installation

First, install PhantomJS (full guide). On OS X:

$ brew install phantomjs

Then install the rubygem:

$ gem install access_lint

Usage

Command Line

From the command line, specify a url or filename to be audited:

$ access_lint audit http://twitter.com # url or a path to a file
# results ...

Ruby

Run the audit from a Ruby application like so

$ irb
> require 'access_lint'
=> true
> AccessLint::Audit.new('http://twitter.com').run
=> results ...

Results Object

{
    "PASS": [                                                           # Status group
        { 
            "element_names": ["<p class=\"foo\">relevant element</p>"], # applicable DOM elements
            "severity": "WARNING",                                      # 'WARNING' or 'SEVERE'
            "status": "PASS",                                           # 'PASS', 'FAIL', or 'NA'
            "title": "Some description"                                 # rule description
        }, 
        { ... }
    ],
    "NA": [ { ... } ],
    "FAIL": [ { ... }]
]

Rules

For full descriptions of the audit rules, visit the Accessibility Developer Tools project wiki