kudzu 1.1.0 → 1.1.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: 0ba76e95628d94560421358aa7982bdc429971e4
4
- data.tar.gz: e1875f5760573a021fcf129018aaba5f6213ad23
3
+ metadata.gz: 5f86cee75f22a954e94c9606c6ce126b2859885d
4
+ data.tar.gz: cb19f958c5c490a9e4fa6aefba38491a806e955f
5
5
  SHA512:
6
- metadata.gz: 4f17f799c2ad67722860bbad00e9e220db8265221d598aebbbd181fea41546454e954fc67db18abba2b8b68797fe44da3887ec4ea3a5d2486fd1afd61584c152
7
- data.tar.gz: 65d3bf42fafbcf835740ebe5534a52163f09ef313795152fafadc87aeaa335d540b037180a4f03208471361a9284635ff15a85471f3def22ba43e341ee1eb724
6
+ metadata.gz: 608f8e917dc323fe778039917b14eb78c9ab3adbb7aa3e4d3872bd9edaece9613fa77f53a813c010c5f0638b9505adf393e79e83279672ea9e0d8c96c5903945
7
+ data.tar.gz: 0a341018ffe7c2f83f8e9a91495b54ad84c2202eb3967185e3a2d63c1cbc58ef5f38d8f50c56733e7b924f60c5f7a01a007499a853a046a6c437940a6d378f0c
@@ -2,7 +2,7 @@ module Kudzu
2
2
  class Agent
3
3
  class Robots
4
4
  def initialize(config)
5
- @user_agent = config.user_agent
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.to_s)
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
@@ -1,3 +1,3 @@
1
1
  module Kudzu
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
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.0
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-04 00:00:00.000000000 Z
11
+ date: 2018-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable