awesome_bot 1.11.0 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +4 -0
- data/README.md +12 -6
- data/lib/awesome_bot/cli.rb +5 -0
- data/lib/awesome_bot/result.rb +6 -0
- 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: 61e7d39fd465602a61c824ad316ac2d6f0b116c3
|
4
|
+
data.tar.gz: 8e662e958ea3c4744d0e2ac64e94ea32755e2e82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4226ba76b6387d7b5a3ed4c251613ca39be19c366494694d954e4984e3286e2e1e13a791842cc7ba57fe9293e90dcb042ca372236de7ab834c68bf2f3d26c70
|
7
|
+
data.tar.gz: d9d51330bf8f9f70e76178b291a973e7e46998dc9448fcf7025734dbca6c9a11343427a63c367441a00eb432e6b607d23bfa3b9dd39c35a51b78dd17ff098ae7
|
data/.travis.yml
CHANGED
@@ -12,6 +12,7 @@ script:
|
|
12
12
|
- awesome_bot bin/assets/test-timeout --allow-timeout --set-timeout 1
|
13
13
|
- awesome_bot bin/assets/test-timeout-and-redirect --allow-timeout --set-timeout 1 --allow-redirect
|
14
14
|
- awesome_bot bin/assets/test-redirect --allow-redirect
|
15
|
+
- awesome_bot bin/assets/test-redirect --allow-redirect -a 301
|
15
16
|
- awesome_bot bin/assets/test-statuses --white-list bot,bad,super
|
16
17
|
- awesome_bot bin/assets/test-errors
|
17
18
|
- awesome_bot -f bin/assets/test-no-issues,bin/assets/test-no-links
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -22,6 +22,7 @@ Verify links in [awesome](status/status.md) projects
|
|
22
22
|
Usage: awesome_bot [file or files]
|
23
23
|
awesome_bot [options]
|
24
24
|
-f, --files [files] Comma separated files to check
|
25
|
+
-a, --allow [errors] Status code errors to allow
|
25
26
|
--allow-dupe Duplicate URLs are allowed
|
26
27
|
--allow-ssl SSL errors are allowed
|
27
28
|
--allow-redirect Redirected URLs are allowed
|
@@ -32,11 +33,12 @@ Usage: awesome_bot [file or files]
|
|
32
33
|
|
33
34
|
- You can check multiple files (comma separated or `*` pattern, look below for details).
|
34
35
|
|
35
|
-
- By default, `
|
36
|
+
- By default, duplicate URLs or any status code other than `200` are flagged as failures.
|
36
37
|
|
37
38
|
- Use option `--allow-dupe` to allow duplicates.
|
38
|
-
- Use option `--allow-redirect` to
|
39
|
-
-
|
39
|
+
- Use option `--allow-redirect` to allow redirects.
|
40
|
+
- Use option `--allow` to allow specific status code errors.
|
41
|
+
- Use option `--white-list` (`-w` for short) to prevent links from being flagged: `-w domain1.com/post/article,domain2.com` white lists `domain1.com/post/article` and all links matching `domain2.com`.
|
40
42
|
|
41
43
|
### Examples
|
42
44
|
|
@@ -63,7 +65,7 @@ Issues :-(
|
|
63
65
|
```
|
64
66
|
|
65
67
|
```shell
|
66
|
-
$ awesome_bot README.md --allow-dupe --allow-redirect
|
68
|
+
$ awesome_bot README.md --allow-dupe --allow-redirect -w rubydoc,giphy
|
67
69
|
# allow redirects, dupes and white list all links matching rubydoc and giphy
|
68
70
|
|
69
71
|
$ awesome_bot README.md,README-zh.md
|
@@ -72,8 +74,12 @@ $ awesome_bot README.md,README-zh.md
|
|
72
74
|
$ awesome_bot docs/*.md
|
73
75
|
# check all markdown files in docs/ directory
|
74
76
|
|
75
|
-
$ awesome_bot README.md --allow-timeout
|
77
|
+
$ awesome_bot README.md --allow-timeout -t 5
|
76
78
|
# speed up validation by setting a timeout of 5s per link request and allowing timeouts
|
79
|
+
|
80
|
+
$ awesome_bot README.md --allow 403,429
|
81
|
+
# allow status code errors 403 and 429
|
82
|
+
# --allow 301 would be similar to --allow-redirect
|
77
83
|
```
|
78
84
|
|
79
85
|
```shell
|
@@ -90,7 +96,7 @@ Switched to a new branch 'new-branch'
|
|
90
96
|
(new-branch) $ git diff master.. --name-only | grep '.md' | xargs awesome_bot
|
91
97
|
> Checking links in new-readme.md
|
92
98
|
Links to check: 1
|
93
|
-
1. https://github.com/dkhamsing
|
99
|
+
1. https://github.com/dkhamsing
|
94
100
|
Checking URLs: ✓
|
95
101
|
No issues :-)
|
96
102
|
|
data/lib/awesome_bot/cli.rb
CHANGED
@@ -19,6 +19,7 @@ module AwesomeBot
|
|
19
19
|
" #{PROJECT} [options]"
|
20
20
|
|
21
21
|
opts.on('-f', '--files [files]', Array, 'Comma separated files to check') { |val| options['files'] = val }
|
22
|
+
opts.on('-a', '--allow [errors]', Array, 'Status code errors to allow') { |val| options['errors'] = val }
|
22
23
|
opts.on('--allow-dupe', TrueClass, 'Duplicate URLs are allowed') { |val| options['allow_dupe'] = val }
|
23
24
|
opts.on('--allow-ssl', TrueClass, 'SSL errors are allowed') { |val| options['allow_ssl'] = val }
|
24
25
|
opts.on('--allow-redirect', TrueClass, 'Redirected URLs are allowed') { |val| options['allow_redirect'] = val }
|
@@ -74,6 +75,9 @@ module AwesomeBot
|
|
74
75
|
|
75
76
|
puts "> Checking links in #{filename}"
|
76
77
|
|
78
|
+
errors = options['errors']
|
79
|
+
puts "> Will allow errors: #{errors.join ','}" unless errors.nil?
|
80
|
+
|
77
81
|
skip_dupe = options['allow_dupe']
|
78
82
|
puts '> Will allow duplicate links' if skip_dupe == true
|
79
83
|
|
@@ -116,6 +120,7 @@ module AwesomeBot
|
|
116
120
|
allow_timeouts = false if allow_timeouts.nil?
|
117
121
|
|
118
122
|
options = {
|
123
|
+
'errors' => errors,
|
119
124
|
'redirect' => allow_redirects,
|
120
125
|
'ssl' => allow_ssl,
|
121
126
|
'timeout' => allow_timeouts
|
data/lib/awesome_bot/result.rb
CHANGED
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.12.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-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|