awesome_bot 1.12.1 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/bin/assets/test-ssl +0 -2
- data/lib/awesome_bot/cli.rb +17 -2
- data/lib/awesome_bot/output.rb +19 -4
- data/lib/awesome_bot/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: 5339a2c603f81d4366910e4bf0796dadaef12736
|
4
|
+
data.tar.gz: dd2afbc414a8ba086a1e436eb9668429867ae756
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51a17797b8a6518b3b9e3e3ab0583de3ec1364985596cfcfb5d3e04e745a34ddb76f6bce822352a572e56204944bd3bfb11a398bd876e8dbee5a0128ab44781f
|
7
|
+
data.tar.gz: 9bb7ee011f0b71a2a37031ff20b85816efd907ab97612103022b5b4f2a7bfffe5041eb6b7638f677536408e546e8632f5b8556639e405179b8044983029fb0ef
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
Changes by [Daniel Khamsing][] unless otherwise noted.
|
4
4
|
|
5
|
+
# 1.13.0
|
6
|
+
|
7
|
+
- add filtered issues artifacts that can be used to [generate a report](https://github.com/dkhamsing/awesome_bot/issues/95) (this changes an internal `output` format)
|
8
|
+
|
5
9
|
# 1.12.1
|
6
10
|
|
7
11
|
- handle invalid byte sequence, reported by [Manu Zhang](https://github.com/manuzhang)
|
data/bin/assets/test-ssl
CHANGED
data/lib/awesome_bot/cli.rb
CHANGED
@@ -107,12 +107,16 @@ module AwesomeBot
|
|
107
107
|
print o
|
108
108
|
end
|
109
109
|
|
110
|
+
filtered_issues = []
|
111
|
+
|
110
112
|
digits = number_of_digits content
|
111
113
|
unless r.white_listed.nil?
|
112
114
|
puts "\n> White listed:"
|
113
115
|
o = order_by_loc r.white_listed, content
|
114
116
|
o.each_with_index do |x, k|
|
115
|
-
|
117
|
+
temp, h = output(x, k, pad_list(o), digits)
|
118
|
+
filtered_issues.push h
|
119
|
+
puts temp
|
116
120
|
end
|
117
121
|
end
|
118
122
|
|
@@ -140,7 +144,9 @@ module AwesomeBot
|
|
140
144
|
else
|
141
145
|
o = order_by_loc r.statuses_issues(options), content
|
142
146
|
o.each_with_index do |x, k|
|
143
|
-
|
147
|
+
temp, h = output(x, k, pad_list(o), digits)
|
148
|
+
filtered_issues.push h
|
149
|
+
puts temp
|
144
150
|
end
|
145
151
|
end
|
146
152
|
|
@@ -166,6 +172,7 @@ module AwesomeBot
|
|
166
172
|
end
|
167
173
|
|
168
174
|
cli_write_results(filename, r)
|
175
|
+
cli_write_results_filtered(filename, filtered_issues)
|
169
176
|
return 'Issues'
|
170
177
|
end
|
171
178
|
end
|
@@ -176,5 +183,13 @@ module AwesomeBot
|
|
176
183
|
r.write results_file
|
177
184
|
puts "\nWrote results to #{results_file}"
|
178
185
|
end
|
186
|
+
|
187
|
+
def cli_write_results_filtered(file, filtered)
|
188
|
+
require 'json'
|
189
|
+
results_file_filter = file.gsub('/','-')
|
190
|
+
results_file = "#{RESULTS_PREFIX}-#{results_file_filter}-filtered.json"
|
191
|
+
File.open(results_file, 'w') { |f| f.write JSON.pretty_generate(filtered) }
|
192
|
+
puts "Wrote filtered results to #{results_file}"
|
193
|
+
end
|
179
194
|
end # class
|
180
195
|
end
|
data/lib/awesome_bot/output.rb
CHANGED
@@ -50,12 +50,27 @@ module AwesomeBot
|
|
50
50
|
def output(x, index, total, largest)
|
51
51
|
s = x['status']
|
52
52
|
|
53
|
+
loc = x['loc']
|
54
|
+
status = s == STATUS_ERROR ? '' : s
|
55
|
+
link = x['url']
|
56
|
+
redirect = output_redirect x
|
57
|
+
|
58
|
+
hash = {
|
59
|
+
'loc'=> loc,
|
60
|
+
'status'=> s,
|
61
|
+
'link'=> link,
|
62
|
+
'redirect'=> redirect
|
63
|
+
}
|
64
|
+
|
65
|
+
o =
|
53
66
|
" #{pad_text index + 1, total}. " \
|
54
|
-
"#{loc_formatted
|
55
|
-
"#{
|
56
|
-
"#{
|
67
|
+
"#{loc_formatted loc, largest} " \
|
68
|
+
"#{status} " \
|
69
|
+
"#{link} " \
|
57
70
|
"#{s == STATUS_ERROR ? x['error'] : ''}" \
|
58
|
-
"#{
|
71
|
+
"#{redirect} \n"
|
72
|
+
|
73
|
+
[o, hash]
|
59
74
|
end
|
60
75
|
|
61
76
|
def output_redirect(x)
|
data/lib/awesome_bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awesome_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Khamsing
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|