accesslint-ci 0.3.5 → 0.3.6
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/lib/accesslint/ci/cli.rb +12 -8
- data/lib/accesslint/ci/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b84cc810a4b4291d975e738d0d6c734203b1f1d
|
4
|
+
data.tar.gz: 17fa603b96b05d85ad14918f05504686e649d0a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5db9b0022c90f1bb2c7095f2ff4520db3c0ed4c303f0d7bacfcc0fb626f8079e41c3133cb9779b71f78d5a26ef095803d559daab78637e2621ea44cde62f3133
|
7
|
+
data.tar.gz: 9981410bcb87e005016b1b7d3884245d6a195d3e4b36b6a1c934602762b06237d7035e173ecb02c2412967a72624bb3529733fdcaed669f8a6a3f726f3fd72a6
|
data/lib/accesslint/ci/cli.rb
CHANGED
@@ -12,11 +12,11 @@ module Accesslint
|
|
12
12
|
def scan(host)
|
13
13
|
@host = host
|
14
14
|
|
15
|
+
save_diff
|
16
|
+
|
15
17
|
if skip_ci?
|
16
18
|
puts current_errors
|
17
|
-
return
|
18
19
|
elsif pr? && changes?
|
19
|
-
save_diff
|
20
20
|
post_comment
|
21
21
|
end
|
22
22
|
end
|
@@ -70,8 +70,10 @@ module Accesslint
|
|
70
70
|
def existing_diff
|
71
71
|
if previous_diff_file
|
72
72
|
@existing_diff ||= ReadAccesslintLog.perform(previous_diff_file)
|
73
|
-
|
73
|
+
elsif circle_ci? && pr?
|
74
74
|
@existing_diff ||= LogManager.get.split("\n")
|
75
|
+
else
|
76
|
+
[]
|
75
77
|
end
|
76
78
|
end
|
77
79
|
|
@@ -79,6 +81,10 @@ module Accesslint
|
|
79
81
|
options[:compare]
|
80
82
|
end
|
81
83
|
|
84
|
+
def circle_ci?
|
85
|
+
!skip_ci?
|
86
|
+
end
|
87
|
+
|
82
88
|
def save_diff
|
83
89
|
WriteAccesslintLog.perform(
|
84
90
|
file_name: new_diff_file,
|
@@ -87,7 +93,7 @@ module Accesslint
|
|
87
93
|
end
|
88
94
|
|
89
95
|
def new_diff_file
|
90
|
-
options[:outfile] || previous_diff_file
|
96
|
+
options[:outfile] || previous_diff_file || "accesslint.diff"
|
91
97
|
end
|
92
98
|
|
93
99
|
def post_comment
|
@@ -107,10 +113,8 @@ module Accesslint
|
|
107
113
|
|
108
114
|
class WriteAccesslintLog
|
109
115
|
def self.perform(file_name:, contents:)
|
110
|
-
|
111
|
-
|
112
|
-
file.write(contents)
|
113
|
-
end
|
116
|
+
File.open(file_name, "w") do |file|
|
117
|
+
file.write(contents)
|
114
118
|
end
|
115
119
|
end
|
116
120
|
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.3.
|
4
|
+
version: 0.3.6
|
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-04-
|
11
|
+
date: 2017-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|