awesome_bot 1.10.0 → 1.11.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 +6 -0
- data/bin/assets/test-errors +4 -0
- data/bin/assets/test-timeout +0 -1
- data/lib/awesome_bot/net.rb +5 -4
- data/lib/awesome_bot/result.rb +3 -2
- 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: 44c4121f5cf211f02e3f55149a31681a4e5eb854
|
4
|
+
data.tar.gz: ebe9cfa3f4bd160fe34c12b3737c8bcabdce2512
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffcb771a6ac91866f80aba48188d059467928a1c0e8bdd3c726da95e800585bccd2d0e3319e471fc94285748e9b79db9f3796375883efdf42f8816c7222f3d3d
|
7
|
+
data.tar.gz: c374442c4a9fdeb8bab0c912f590f8c71f42aa04ee870b2edcdc65beaa529e7d7d5066c5754f69b26f17503635d2534405ed067dfc0fb8c591259528f34b518f
|
data/.travis.yml
CHANGED
@@ -18,5 +18,6 @@ script:
|
|
18
18
|
- awesome_bot -f bin/assets/test-no-issues,bin/assets/test-redirect --allow-redirect
|
19
19
|
- awesome_bot bin/assets/test-no-* --allow-redirect
|
20
20
|
- awesome_bot bin/assets/test-ssl --allow-ssl
|
21
|
+
- awesome_bot bin/assets/test-errors
|
21
22
|
- awesome_bot README.md --allow-dupe --white-list gph.is,giphy,travis-ci.org,codeload,badge,rubydoc,rubygems,circleci
|
22
23
|
- gem install awesome_bot
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
Changes by [Daniel Khamsing][] unless otherwise noted.
|
4
4
|
|
5
|
+
# 1.11.0
|
6
|
+
|
7
|
+
- [net] set `awesome_bot` user agent
|
8
|
+
- pretty print `json` file
|
9
|
+
- include `all` links status in results
|
10
|
+
|
5
11
|
# 1.10.0
|
6
12
|
|
7
13
|
- add `allow-ssl` option, suggested by [Joe Block](https://github.com/unixorn)
|
data/bin/assets/test-errors
CHANGED
@@ -10,3 +10,7 @@
|
|
10
10
|
10. [L1446] 401 https://developer.apple.com/testflight/
|
11
11
|
11. [L1453] 401 https://developer.apple.com/app-store/review/rejections/
|
12
12
|
13. [L1587] 401 https://developer.apple.com/swift/blog/
|
13
|
+
https://www.reddit.com/r/fishshell/
|
14
|
+
14. [L1588] 429 https://www.reddit.com/r/iosprogramming
|
15
|
+
17. [L1689] 503 http://www.amazon.com/Programming-Objective-C-6th-Developers-Library/dp/0321967607
|
16
|
+
18. [L1692] 503 http://www.amazon.com/Core-Data-iOS-Data-Driven-Applications/dp/0321670426
|
data/bin/assets/test-timeout
CHANGED
data/lib/awesome_bot/net.rb
CHANGED
@@ -10,10 +10,11 @@ module AwesomeBot
|
|
10
10
|
|
11
11
|
uri = URI.parse url
|
12
12
|
Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https', :open_timeout => timeout) do |http|
|
13
|
+
ua = {'User-Agent' => 'awesome_bot'}
|
13
14
|
if head
|
14
|
-
request = Net::HTTP::Head.new
|
15
|
+
request = Net::HTTP::Head.new(uri,ua)
|
15
16
|
else
|
16
|
-
request = Net::HTTP::Get.new
|
17
|
+
request = Net::HTTP::Get.new(uri,ua)
|
17
18
|
end
|
18
19
|
response = http.request request
|
19
20
|
|
@@ -22,7 +23,7 @@ module AwesomeBot
|
|
22
23
|
headers = {}
|
23
24
|
response.each do |k, v|
|
24
25
|
if k=='location'
|
25
|
-
headers[k] = v.force_encoding("utf-8")
|
26
|
+
headers[k] = v.force_encoding("utf-8")
|
26
27
|
else
|
27
28
|
headers[k] = v
|
28
29
|
end
|
@@ -43,7 +44,7 @@ module AwesomeBot
|
|
43
44
|
Parallel.each(links, in_threads: threads) do |u|
|
44
45
|
begin
|
45
46
|
status, headers = net_status u, timeout, head
|
46
|
-
error = nil
|
47
|
+
error = nil
|
47
48
|
rescue => e
|
48
49
|
status = STATUS_ERROR
|
49
50
|
headers = {}
|
data/lib/awesome_bot/result.rb
CHANGED
@@ -70,7 +70,7 @@ module AwesomeBot
|
|
70
70
|
require 'json'
|
71
71
|
|
72
72
|
r = write_artifacts
|
73
|
-
File.open(filename, 'w') { |f| f.write r
|
73
|
+
File.open(filename, 'w') { |f| f.write JSON.pretty_generate(r) }
|
74
74
|
end
|
75
75
|
|
76
76
|
def write_artifacts
|
@@ -78,7 +78,8 @@ module AwesomeBot
|
|
78
78
|
{
|
79
79
|
'date'=>Time.now,
|
80
80
|
'links'=>@links,
|
81
|
-
'
|
81
|
+
'issues'=>statuses_issues,
|
82
|
+
'all'=>status
|
82
83
|
}
|
83
84
|
end
|
84
85
|
end # class
|
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.11.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-05-
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|