accesslint-ci 0.2.8 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/accesslint-ci.gemspec +2 -2
- data/lib/accesslint/ci/cli.rb +23 -3
- data/lib/accesslint/ci/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3840fab63725b20542c997c0cd062b3103f2846c
|
4
|
+
data.tar.gz: 3917337c92e34239f5b96fd067a50bdf40f370b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f59a26bb277105362edf16ad7469fc02cd5ad66825c2f012a92ea57397767ff749af95f1959ed84fdb335a00c0d7d22a862ba3b39edd5bd5fa7d86aff2f5ca3
|
7
|
+
data.tar.gz: d69831972181023f729bb2d9615ae6caac33c9446fda4145ffdb3c34a7f28060589f246a41506f74e02ed998fe4638ca13c74f534a12d5fe33ee67c49849c2bd
|
data/accesslint-ci.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Cameron Cundiff"]
|
10
10
|
spec.email = ["hello@thoughtbot.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{Run accessibility tests in
|
13
|
-
spec.description = %q{accesslint-ci runs accessibility tests in
|
12
|
+
spec.summary = %q{Run accessibility tests in CI builds}
|
13
|
+
spec.description = %q{accesslint-ci runs accessibility tests in CI and comments on corresponding GitHub pull requests}
|
14
14
|
spec.homepage = "https://www.github.com/accesslint/accesslint-ci"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
data/lib/accesslint/ci/cli.rb
CHANGED
@@ -6,6 +6,8 @@ module Accesslint
|
|
6
6
|
desc "scan HOST", "scan HOST"
|
7
7
|
option :"skip-ci", type: :boolean
|
8
8
|
option :"hosted", type: :boolean
|
9
|
+
option :"compare", type: :string
|
10
|
+
option :"outfile", type: :string
|
9
11
|
def scan(host)
|
10
12
|
current = Scanner.perform(host: host).split("\n")
|
11
13
|
|
@@ -13,22 +15,40 @@ module Accesslint
|
|
13
15
|
existing = []
|
14
16
|
|
15
17
|
if ENV.fetch("CIRCLE_BRANCH") != "master"
|
16
|
-
if
|
18
|
+
if options[:compare]
|
19
|
+
existing = ReadAccesslintLog.perform(options[:compare])
|
20
|
+
elsif !options[:hosted]
|
17
21
|
existing = LogManager.get.split("\n")
|
18
22
|
end
|
19
23
|
|
20
24
|
diff = current - existing
|
21
25
|
|
26
|
+
puts diff
|
27
|
+
|
22
28
|
if diff.any?
|
29
|
+
outfile = options[:outfile] || "tmp/accesslint.diff"
|
30
|
+
|
31
|
+
File.open(outfile, "w") do |file|
|
32
|
+
file.write(diff.join("\n"))
|
33
|
+
end
|
34
|
+
|
23
35
|
Commenter.perform(diff)
|
24
36
|
end
|
25
37
|
end
|
26
|
-
|
27
|
-
puts diff
|
28
38
|
else
|
29
39
|
puts current
|
30
40
|
end
|
31
41
|
end
|
32
42
|
end
|
43
|
+
|
44
|
+
class ReadAccesslintLog
|
45
|
+
def self.perform(file_name)
|
46
|
+
if File.exist?(file_name)
|
47
|
+
File.open(file_name, "r") { |file| file.read }.split("\n")
|
48
|
+
else
|
49
|
+
[]
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
33
53
|
end
|
34
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: accesslint-ci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Cundiff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0.19'
|
125
|
-
description: accesslint-ci runs accessibility tests in
|
125
|
+
description: accesslint-ci runs accessibility tests in CI and comments on corresponding
|
126
126
|
GitHub pull requests
|
127
127
|
email:
|
128
128
|
- hello@thoughtbot.com
|
@@ -172,8 +172,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
version: '0'
|
173
173
|
requirements: []
|
174
174
|
rubyforge_project:
|
175
|
-
rubygems_version: 2.
|
175
|
+
rubygems_version: 2.5.1
|
176
176
|
signing_key:
|
177
177
|
specification_version: 4
|
178
|
-
summary: Run accessibility tests in
|
178
|
+
summary: Run accessibility tests in CI builds
|
179
179
|
test_files: []
|