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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 579b7cb269ffa2b68154fb856d45ce053ec0d521
4
- data.tar.gz: be39e06b6476aa7dc46a46c8b191ba72f1480645
3
+ metadata.gz: 44c4121f5cf211f02e3f55149a31681a4e5eb854
4
+ data.tar.gz: ebe9cfa3f4bd160fe34c12b3737c8bcabdce2512
5
5
  SHA512:
6
- metadata.gz: 3d18b3b61f7e4bc5dc0d72408ea9201b1b795f18274e1933f83d80626310f99438d239aaba01e78abeef7395b16511076bb8c3ce10397bf120a1454b1ea024b6
7
- data.tar.gz: f4c6b23f500f4de422332e2f3cb8261ba612314e60440152bd0648394a31f7a05c29315f4a21988d153f396bf3193f9eb1146a899bad8ff5a55bef527d6de1af
6
+ metadata.gz: ffcb771a6ac91866f80aba48188d059467928a1c0e8bdd3c726da95e800585bccd2d0e3319e471fc94285748e9b79db9f3796375883efdf42f8816c7222f3d3d
7
+ data.tar.gz: c374442c4a9fdeb8bab0c912f590f8c71f42aa04ee870b2edcdc65beaa529e7d7d5066c5754f69b26f17503635d2534405ed067dfc0fb8c591259528f34b518f
@@ -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
@@ -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)
@@ -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
@@ -1,3 +1,2 @@
1
1
  http://www.cmr.osu.edu/browse/datasets
2
2
  https://github.com
3
- http://github.com
@@ -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 uri
15
+ request = Net::HTTP::Head.new(uri,ua)
15
16
  else
16
- request = Net::HTTP::Get.new uri
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 # nil (success)
47
+ error = nil
47
48
  rescue => e
48
49
  status = STATUS_ERROR
49
50
  headers = {}
@@ -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.to_json }
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
- 'results'=>statuses_issues
81
+ 'issues'=>statuses_issues,
82
+ 'all'=>status
82
83
  }
83
84
  end
84
85
  end # class
@@ -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.10.0'
8
+ VERSION = '1.11.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.10.0
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-27 00:00:00.000000000 Z
11
+ date: 2016-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel