accesslint-ci 0.2.8 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1eb6d548fb8a5b90a0147114fdde5e605d43b071
4
- data.tar.gz: 7bf2d4e2733a04ea8312bd8523b4f3ceb6ef566a
3
+ metadata.gz: 3840fab63725b20542c997c0cd062b3103f2846c
4
+ data.tar.gz: 3917337c92e34239f5b96fd067a50bdf40f370b8
5
5
  SHA512:
6
- metadata.gz: f298dc72e0a780603aebeac8920a66d9df2107788dee823b53c394cd64d7927a37f6d3d7e0d39b724829228b8604d7d8cbb80cdcbad27ce59eb5df841188a8f4
7
- data.tar.gz: a9b4bf831aa961c671bb470fa5e8c204aac40980037be86b4428f7187ffe6d85b42fbd9ca5cac89944e9ad84e45f96b3bb6a52dd6753b12522ba20e80aacc069
6
+ metadata.gz: 8f59a26bb277105362edf16ad7469fc02cd5ad66825c2f012a92ea57397767ff749af95f1959ed84fdb335a00c0d7d22a862ba3b39edd5bd5fa7d86aff2f5ca3
7
+ data.tar.gz: d69831972181023f729bb2d9615ae6caac33c9446fda4145ffdb3c34a7f28060589f246a41506f74e02ed998fe4638ca13c74f534a12d5fe33ee67c49849c2bd
@@ -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 CircleCI builds}
13
- spec.description = %q{accesslint-ci runs accessibility tests in CircleCI and comments on corresponding GitHub pull requests}
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
 
@@ -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 !options[:"hosted"]
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
@@ -1,5 +1,5 @@
1
1
  module Accesslint
2
2
  module Ci
3
- VERSION = "0.2.8"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  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.2.8
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-03-11 00:00:00.000000000 Z
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 CircleCI and comments on corresponding
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.6.9
175
+ rubygems_version: 2.5.1
176
176
  signing_key:
177
177
  specification_version: 4
178
- summary: Run accessibility tests in CircleCI builds
178
+ summary: Run accessibility tests in CI builds
179
179
  test_files: []