access_lint 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +10 -0
- data/Gemfile +2 -0
- data/README.md +39 -22
- data/lib/access_lint/audit.rb +1 -1
- data/lib/access_lint/version.rb +1 -1
- data/spec/access_lint/cli_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 510e223f7fbb149bb0163c0e69fddfb1768dd44c
|
4
|
+
data.tar.gz: 08b09c47db4e8a4a48abcfc911d35ddf31f2cadd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ecabff2f9435dc98d437f8e87fd4263197f56821fcbc1e91206f4153d1fcae38e04b6d3700c71dd22a8623ba25664ccb6cc5dfbfd75e7915992004bd73490ce
|
7
|
+
data.tar.gz: bfdf0a14d56951d7642367fe5b1043bf7bda08386b9ade31a4fd50270bc54924236b948aa5f96ae869d9aeb2e3b07c30e15c518b983653da8cadf1feeda9fcad
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
repo_token: 5y51cPVUZJB5XeD9gbX0DkFMiA977CEUe
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,42 +1,55 @@
|
|
1
|
-
#
|
1
|
+
# access_lint [](https://travis-ci.org/ckundo/access_lint) [](http://badge.fury.io/rb/access_lint) [](https://codeclimate.com/repos/52c4c7ca6956804bb2000905/feed) [](https://coveralls.io/r/ckundo/access_lint?branch=master)
|
2
2
|
|
3
|
-
Run accessibility audits on
|
3
|
+
Run web accessibility audits on urls or files, from the command line or within Ruby.
|
4
4
|
|
5
5
|
## About
|
6
6
|
|
7
|
-
AccessLint uses the [Accessibility Developer Tools](https://github.com/GoogleChrome/accessibility-developer-tools) javascript library to make assertions on the DOM via PhantomJS.
|
7
|
+
AccessLint uses the [Accessibility Developer Tools](https://github.com/GoogleChrome/accessibility-developer-tools) javascript library to make assertions on the DOM via PhantomJS. The rules that are applied are [listed below](#rules).
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
11
|
+
First, install PhantomJS ([full guide](http://phantomjs.org/)). On OS X:
|
12
|
+
|
11
13
|
$ brew install phantomjs
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
$ access_lint audit <url-or-filename>
|
15
|
+
Then install the rubygem:
|
16
16
|
|
17
|
-
|
17
|
+
$ gem install access_lint
|
18
18
|
|
19
|
-
|
19
|
+
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
### Command Line
|
22
22
|
|
23
|
-
|
23
|
+
From the command line, specify a url or filename to be audited:
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
"element_names": ["<p class=\"foo\">relevant element</p>"], # array of string values for applicable DOM nodes
|
28
|
-
"elements": [DOM node], # array of failing nodes as DOM objects.
|
29
|
-
"severity": "WARNING", # string for the severity of the failure.
|
30
|
-
"status": "PASS", # 'PASS', 'FAIL', or 'NA'
|
31
|
-
"title": "Some description" # string description of the failure.
|
32
|
-
}
|
33
|
-
]
|
25
|
+
$ access_lint audit http://twitter.com # url or a path to a file
|
26
|
+
# results ...
|
34
27
|
|
35
|
-
###
|
28
|
+
### Ruby
|
36
29
|
|
37
|
-
|
30
|
+
Run the audit from a Ruby application like so
|
38
31
|
|
39
|
-
|
32
|
+
$ irb
|
33
|
+
> require 'access_lint'
|
34
|
+
=> true
|
35
|
+
> AccessLint::Audit.new('http://twitter.com').run
|
36
|
+
=> results ...
|
37
|
+
|
38
|
+
### Results Object
|
39
|
+
|
40
|
+
{
|
41
|
+
"PASS": [ # Status group
|
42
|
+
{
|
43
|
+
"element_names": ["<p class=\"foo\">relevant element</p>"], # applicable DOM elements
|
44
|
+
"severity": "WARNING", # 'WARNING' or 'SEVERE'
|
45
|
+
"status": "PASS", # 'PASS', 'FAIL', or 'NA'
|
46
|
+
"title": "Some description" # rule description
|
47
|
+
},
|
48
|
+
{ ... }
|
49
|
+
],
|
50
|
+
"NA": [ { ... } ],
|
51
|
+
"FAIL": [ { ... }]
|
52
|
+
]
|
40
53
|
|
41
54
|
## Rules
|
42
55
|
|
@@ -57,6 +70,10 @@ For full descriptions of the audit rules, visit the [Accessibility Developer Too
|
|
57
70
|
* Elements with ARIA roles must have all required attributes for that role
|
58
71
|
* Video elements should use <track> elements to provide captions
|
59
72
|
|
73
|
+
## Roadmap
|
74
|
+
|
75
|
+
Visit the project backlog: <https://www.pivotaltracker.com/s/projects/985186>.
|
76
|
+
|
60
77
|
## Contributing
|
61
78
|
|
62
79
|
1. Fork it
|
data/lib/access_lint/audit.rb
CHANGED
@@ -26,7 +26,7 @@ module AccessLint
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def parse_output
|
29
|
-
raw_results = JSON.parse(@output)
|
29
|
+
raw_results = JSON.parse(@output, max_nesting: 200)
|
30
30
|
raw_results.map { |result| result.delete('elements') }
|
31
31
|
@results = raw_results.group_by { |result| result['status'] }
|
32
32
|
rescue Exception => e
|
data/lib/access_lint/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: access_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Cundiff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -74,8 +74,11 @@ executables:
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
+
- .coveralls.yml
|
77
78
|
- .gitignore
|
78
79
|
- .rspec
|
80
|
+
- .travis.yml
|
81
|
+
- CHANGELOG.md
|
79
82
|
- Gemfile
|
80
83
|
- LICENSE.txt
|
81
84
|
- README.md
|