access_lint 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c24905f58182a273d81c472cb6039096550665b5
4
- data.tar.gz: 64e9ae9282bf3b4a81094952d7a089c3204cbe00
3
+ metadata.gz: 510e223f7fbb149bb0163c0e69fddfb1768dd44c
4
+ data.tar.gz: 08b09c47db4e8a4a48abcfc911d35ddf31f2cadd
5
5
  SHA512:
6
- metadata.gz: d92d4c4aaa4e064ca6e246d97bf17748f4a78d6530c2f8e71d37e5c464b42d8a9aef3bc0df1c27f58a883a6c5cb15040894c4dd20f7151353f8652ecefb7c417
7
- data.tar.gz: 9356133444a1c5ab3eed241a6823f1f411fd72d35b29224ba677cb38135d211632474828f2d2f9fa89e5d05d1415e252f33036eb06831da58529eeeabe4146f2
6
+ metadata.gz: 7ecabff2f9435dc98d437f8e87fd4263197f56821fcbc1e91206f4153d1fcae38e04b6d3700c71dd22a8623ba25664ccb6cc5dfbfd75e7915992004bd73490ce
7
+ data.tar.gz: bfdf0a14d56951d7642367fe5b1043bf7bda08386b9ade31a4fd50270bc54924236b948aa5f96ae869d9aeb2e3b07c30e15c518b983653da8cadf1feeda9fcad
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ repo_token: 5y51cPVUZJB5XeD9gbX0DkFMiA977CEUe
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # access_lint Changelog
2
+
3
+ ## v0.1.1
4
+
5
+ * Fix parsing errors on deeply nested JSON.
6
+
7
+ ## v0.1.0
8
+
9
+ * Remove `elements` key from the audit results.
10
+ * Group audit results by status. (N/A, Failing, Passing)
data/Gemfile CHANGED
@@ -10,3 +10,5 @@ group :development do
10
10
  gem "pry-stack_explorer"
11
11
  gem "thor"
12
12
  end
13
+
14
+ gem 'coveralls', require: false
data/README.md CHANGED
@@ -1,42 +1,55 @@
1
- # AccessLint
1
+ # access_lint [![Build Status](https://travis-ci.org/ckundo/access_lint.png)](https://travis-ci.org/ckundo/access_lint) [![Gem Version](https://badge.fury.io/rb/access_lint.png)](http://badge.fury.io/rb/access_lint) [![Code Climate](https://codeclimate.com/repos/52c4c7ca6956804bb2000905/badges/5a971515dcfd43cf57e1/gpa.png)](https://codeclimate.com/repos/52c4c7ca6956804bb2000905/feed) [![Coverage Status](https://coveralls.io/repos/ckundo/access_lint/badge.png?branch=master)](https://coveralls.io/r/ckundo/access_lint?branch=master)
2
2
 
3
- Run accessibility audits on web pages from the command line.
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
- $ gem install access_lint
14
-
15
- $ access_lint audit <url-or-filename>
15
+ Then install the rubygem:
16
16
 
17
- ## Command Line Usage
17
+ $ gem install access_lint
18
18
 
19
- Running the `audit` command will return an array of stringified JSON objects to stdout:
19
+ ## Usage
20
20
 
21
- $ access_lint audit TARGET # TARGET can be a url or a path to a file
21
+ ### Command Line
22
22
 
23
- The JSON structure looks like:
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
- ### Example
28
+ ### Ruby
36
29
 
37
- $ access_lint audit http://ckundo.com
30
+ Run the audit from a Ruby application like so
38
31
 
39
- [{"element_names": ["<span class=\"blogger-gear\"></span>"], "elements": [DOM node], "severity"=>"Warning", "status"=>"FAIL", "title"=>"Meaningful images should not be used in element backgrounds"}, ...]
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module AccessLint
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -4,7 +4,7 @@ require 'access_lint/cli'
4
4
  module AccessLint
5
5
  describe CLI do
6
6
  it 'creates an audit' do
7
- expect { CLI.start }.to_not raise_error
7
+ expect { CLI.start([]) }.to_not raise_error
8
8
  end
9
9
  end
10
10
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
1
4
  $:.unshift File.expand_path('..', __FILE__)
2
5
  $:.unshift File.expand_path('../../lib', __FILE__)
3
6
  require 'rubygems'
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.0
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-02 00:00:00.000000000 Z
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