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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e84b396684fa21d86231abc47feb9ed41b93ff6e
4
- data.tar.gz: 178afbac5f1d6332623454dc0e06c1058abcf280
3
+ metadata.gz: 5339a2c603f81d4366910e4bf0796dadaef12736
4
+ data.tar.gz: dd2afbc414a8ba086a1e436eb9668429867ae756
5
5
  SHA512:
6
- metadata.gz: ffd1d9002e4561b86e6b0e18884e5404b6035bc7fceab60e8d1e8b1de117d477421214c640b4ec74e29dc9de5b235736297565e99eb1a2e72e4d4624dd5aed8a
7
- data.tar.gz: d39f13a048e0a937ce2a8578e81d78880f61ed3d72cb15955895818f5767a8431ba97bbc12d571c6b5539386dfd92ae091c2f82d1f355ce69ada2ff7817d6f5a
6
+ metadata.gz: 51a17797b8a6518b3b9e3e3ab0583de3ec1364985596cfcfb5d3e04e745a34ddb76f6bce822352a572e56204944bd3bfb11a398bd876e8dbee5a0128ab44781f
7
+ data.tar.gz: 9bb7ee011f0b71a2a37031ff20b85816efd907ab97612103022b5b4f2a7bfffe5041eb6b7638f677536408e546e8632f5b8556639e405179b8044983029fb0ef
@@ -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)
@@ -1,5 +1,3 @@
1
1
  https://www.gitbook.io/book/gitbookio/markdown
2
2
  https://this-week-in-rust.org/
3
- https://kismatic.com/
4
- https://kismatic.com/community/introducing-kubernetes-weekly-news/
5
3
  https://data.nasdaq.com/
@@ -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
- puts output x, k, pad_list(o), digits
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
- puts output x, k, pad_list(o), digits
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
@@ -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 x['loc'], largest} " \
55
- "#{s == STATUS_ERROR ? '' : s} " \
56
- "#{x['url']} " \
67
+ "#{loc_formatted loc, largest} " \
68
+ "#{status} " \
69
+ "#{link} " \
57
70
  "#{s == STATUS_ERROR ? x['error'] : ''}" \
58
- "#{output_redirect x} \n"
71
+ "#{redirect} \n"
72
+
73
+ [o, hash]
59
74
  end
60
75
 
61
76
  def output_redirect(x)
@@ -5,5 +5,5 @@ module AwesomeBot
5
5
  'Great for "awesome" projects.'
6
6
  PROJECT_URL = 'https://github.com/dkhamsing/awesome_bot'
7
7
 
8
- VERSION = '1.12.1'
8
+ VERSION = '1.13.0'
9
9
  end
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.12.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-06-14 00:00:00.000000000 Z
11
+ date: 2016-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel