kudzu 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kudzu/agent/robots.rb +5 -3
- data/lib/kudzu/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: 5f86cee75f22a954e94c9606c6ce126b2859885d
|
4
|
+
data.tar.gz: cb19f958c5c490a9e4fa6aefba38491a806e955f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 608f8e917dc323fe778039917b14eb78c9ab3adbb7aa3e4d3872bd9edaece9613fa77f53a813c010c5f0638b9505adf393e79e83279672ea9e0d8c96c5903945
|
7
|
+
data.tar.gz: 0a341018ffe7c2f83f8e9a91495b54ad84c2202eb3967185e3a2d63c1cbc58ef5f38d8f50c56733e7b924f60c5f7a01a007499a853a046a6c437940a6d378f0c
|
data/lib/kudzu/agent/robots.rb
CHANGED
@@ -2,7 +2,7 @@ module Kudzu
|
|
2
2
|
class Agent
|
3
3
|
class Robots
|
4
4
|
def initialize(config)
|
5
|
-
@
|
5
|
+
@config = config
|
6
6
|
@monitor = Monitor.new
|
7
7
|
@txt = {}
|
8
8
|
end
|
@@ -41,7 +41,7 @@ module Kudzu
|
|
41
41
|
return unless txt
|
42
42
|
|
43
43
|
txt.sets.each do |set|
|
44
|
-
return set if @user_agent =~ set.user_agent
|
44
|
+
return set if @config.user_agent =~ set.user_agent
|
45
45
|
end
|
46
46
|
return nil
|
47
47
|
end
|
@@ -62,13 +62,15 @@ module Kudzu
|
|
62
62
|
uri.fragment = uri.query = nil
|
63
63
|
|
64
64
|
http = Net::HTTP.new(uri.host, uri.port || uri.default_port)
|
65
|
+
http.open_timeout = @config.open_timeout if @config.open_timeout
|
66
|
+
http.read_timeout = @config.read_timeout if @config.read_timeout
|
65
67
|
if uri.scheme == 'https'
|
66
68
|
http.use_ssl = true
|
67
69
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
68
70
|
end
|
69
71
|
|
70
72
|
begin
|
71
|
-
http.get(uri.
|
73
|
+
http.get(uri.request_uri)
|
72
74
|
rescue => e
|
73
75
|
Kudzu.log :error, "failed to fetch robots.txt: #{uri}", error: e
|
74
76
|
nil
|
data/lib/kudzu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kudzu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshikazu Kaneta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|