kudzu 1.3.0 → 1.3.1

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
  SHA256:
3
- metadata.gz: 16db7469597ff96bff30c59c9b6da73e8c4d33b535228424675c7e7a539e4ec2
4
- data.tar.gz: ee0eb79b8e5c3e4e3d3832ed1f8e9d0dc291c60f3d626495eb21055e5e23341e
3
+ metadata.gz: 2893a15f2faff7f0697f7ce39f16a6f0e9c0972645c5e19aafb5751153432480
4
+ data.tar.gz: a8b9b0230be54ca43852e5b0700e1ea329258cbffcba284772f8d025ee14cbcf
5
5
  SHA512:
6
- metadata.gz: 6d3a060a674cbd7ec9de94db1d94dcb9c0e6eac1f0b6bb20a798547b8eb3f29a69c0d404ca45dd7efc7f11d91de2618ac214f0d316cbe58fd69276878e37a9bf
7
- data.tar.gz: b423624bc1e7ea849a98cbea9d34b8a1dcfd22f5fd7bee8ce0791e900ac805d2d448776d0a4b7cb1e0be9a9ef033f008700cf16aed62ffa287bccacbb1db0db4
6
+ metadata.gz: 568b1bf560acb842ba3fa768c68078be503f271f7b1eed383ac67e8529bc568fc5ba720fc35f3c4e6973c07beede61baf39710d33ddfc13d01d75dbf14e2b090
7
+ data.tar.gz: 2537befd681ca91912003aad92b02ae69666afcc9fc816b330064c34547e0b94c5981d86ba369f45644b6161cb1fdbc980aea49aef7ec33e2be5a7b698597545
data/lib/kudzu/agent.rb CHANGED
@@ -30,13 +30,21 @@ module Kudzu
30
30
  end
31
31
 
32
32
  def extract_refs(response)
33
+ return [] unless redirect_url_allowed?(response)
33
34
  refs = @url_extractor.extract(response)
34
35
  @url_filterer.filter(refs, response.url)
35
36
  end
36
37
 
37
38
  def filter_response?(response)
38
- return false if response.redirect_from && !@url_filterer.allowed?(response.url, response.redirect_from)
39
+ return true unless redirect_url_allowed?(response)
39
40
  !@page_filterer.allowed?(response)
40
41
  end
42
+
43
+ private
44
+
45
+ def redirect_url_allowed?(response)
46
+ return true if response.redirect_from.nil? || response.redirect_from.empty?
47
+ @url_filterer.allowed?(response.url, response.redirect_from)
48
+ end
41
49
  end
42
50
  end
data/lib/kudzu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kudzu
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.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.3.0
4
+ version: 1.3.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: 2022-01-17 00:00:00.000000000 Z
11
+ date: 2023-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable