awesome_bot 1.3.0 → 1.3.1

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: 3b80a642954635c67e93c87aafb2524e0a89316d
4
- data.tar.gz: 6afbd8b1d0e1b219aea4345f0be7aec0df309a6a
3
+ metadata.gz: 182cc44e0d7d187ee13363f3073b2c1c05f98b28
4
+ data.tar.gz: 35e3cf5aface804f34379547b4f67e3e155daa53
5
5
  SHA512:
6
- metadata.gz: 074d3347f394c15e8c4d21e533bf66a2da153f97187e2ca1b10ca0fc63cb96d634444c3ddc3938ab4a2669415f1b0be55b67620f35ccfd26151f4c7214961675
7
- data.tar.gz: be54ae943b07eb0be805e8530b9b969bc244bf0a375338f1e8da29f22318ddaca6ef354d9d3b130428988740e8725f30fea89688e130096d770803a2c15a12f8
6
+ metadata.gz: 2cc1a1aed1145884249dee0490bf6bd8673247a1815f249404ebd450cc808c2b3f982d3c766234766c994223c0bdb9f9c9b4bb86987d9c5cbcf20a3ca2ae3ba7
7
+ data.tar.gz: 529f3e1a47fab18995c435d38f31f5cee44aebb9b5543577558e0fa5d0fdeffc333d0e0041df22c131220732b628a15d02f36fa2460811addb9e51d564b08ecc
@@ -37,6 +37,11 @@
37
37
  - output `→` as redirect status indicator
38
38
  - update error logic in statuses
39
39
 
40
+ # 1.3.1
41
+
42
+ - fix error with `)` in link parsing, reported by [Halim Qarroum](https://github.com/HQarroum)
43
+ - minor improvement to output
44
+
40
45
  ## Contact
41
46
 
42
47
  - [github.com/dkhamsing](https://github.com/dkhamsing)
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  :rocket: Check for links in [awesome](https://github.com/sindresorhus/awesome) projects
4
4
 
5
- ![](http://i.giphy.com/12qq4Em3MVuwJW.gif)
5
+ ![](http://i.giphy.com/urvsFBDfR6N32.gif)
6
6
 
7
7
  `awesome_bot` checks for valid URLs in a file, it can be used to verify pull requests to update a README with [Travis](#travis).
8
8
 
@@ -133,7 +133,7 @@ script:
133
133
  ## Credits
134
134
 
135
135
  - `faraday`, `parallel` and [more](awesome_bot.gemspec)
136
- - [giphy](http://gph.is/1gU5itl)
136
+ - [giphy](http://gph.is/XM6gMT)
137
137
 
138
138
  ## Contact
139
139
 
@@ -12,6 +12,15 @@ module AwesomeBot
12
12
  USAGE = "\t"
13
13
 
14
14
  class << self
15
+ def output(x, k)
16
+ s = x['status']
17
+ print "#{k + 1}. "
18
+ print "#{s} " unless s == STATUS_ERROR
19
+ print "#{x['url']}"
20
+ print " #{x['error']}" if s == STATUS_ERROR
21
+ puts ''
22
+ end
23
+
15
24
  def cli
16
25
  option_d = "--#{OPTION_DUPE}"
17
26
  option_r = "--#{OPTION_REDIRECT}"
@@ -61,7 +70,7 @@ module AwesomeBot
61
70
  unless r.white_listed.nil?
62
71
  puts "\n> White listed:"
63
72
  r.white_listed.each_with_index do |x, k|
64
- puts " #{k + 1}. #{x['status']}: #{x['url']} "
73
+ output x, k
65
74
  end
66
75
  end
67
76
 
@@ -76,12 +85,7 @@ module AwesomeBot
76
85
  puts " All OK #{STATUS_OK}"
77
86
  else
78
87
  r.statuses_issues(allow_redirects).each_with_index do |x, k|
79
- s = x['status']
80
- print "#{k + 1}. "
81
- print "#{s} " unless s == STATUS_ERROR
82
- print "#{x['url']}"
83
- print x['error'] if s == STATUS_ERROR
84
- puts ''
88
+ output x, k
85
89
  end
86
90
  end
87
91
 
@@ -6,7 +6,16 @@ module AwesomeBot
6
6
  def links_filter(list)
7
7
  list.reject { |x| x.length < 9 }
8
8
  .map do |x|
9
- x.gsub(/\).*/, '').gsub(/'.*/, '').gsub(/,.*/, '').gsub('/:', '/')
9
+ x.gsub(/'.*/, '').gsub(/,.*/, '').gsub('/:', '/')
10
+ end
11
+ .map do |x|
12
+ if x.scan(')').count == 2
13
+ x.gsub(/\)\).*/, ')')
14
+ elsif x.scan(')').count == 1
15
+ x.gsub(/\).*/, '')
16
+ else
17
+ x
18
+ end
10
19
  end
11
20
  end
12
21
 
@@ -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.3.0'
8
+ VERSION = '1.3.1'
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.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Khamsing
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-14 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday