ask-web-fetch 0.5.8 → 0.5.9

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
  SHA256:
3
- metadata.gz: d3e0494d6f9fd54b7b80b667b97d57f17d1b0e871d44c26fada9ad91669a391d
4
- data.tar.gz: e06918a4ca162ee2111715530f67ab68c8feae529c27c180cebb0cf462f13867
3
+ metadata.gz: d8f3dc79c573c21dc567f86edd621ad84da98437ef512faea0e13b36219670d2
4
+ data.tar.gz: 694519194d63c9f4066f943ed2fe472f029ea10afd6e423a41440ff7d8a04964
5
5
  SHA512:
6
- metadata.gz: 4a045bb9226bb302cd60bda942acfa05a00e1f3d1aced99edc3bbd77a061c7650580b40447c385a4777b7156fa81aa0fcc57267caa4385b478e4d005c015f41f
7
- data.tar.gz: ffab19b64968c909c67dd631902b447738248c7e6a0d3da5db8851cc2ff615ec627bc8a89407b40dbeabbebb591d2cd6726c21747de34962cc9ff77c98ce16e8
6
+ metadata.gz: 270301527344d9b49c982e1d7c27dd83117f23c56de3e321f67e15aae7696998d423bd7cec72852a188412ee54b4183736917a5ec6c7030eab888b621af611f1
7
+ data.tar.gz: 66933232dbb0f106362e2a9552f19fc152022c5f9ed9b7ca4bda6fe1d2b3935ce3a3b7288bc2d0130aa8d9bddd6a4e5861ff5ed675e11b763b0e0d171e5749ef
@@ -16,6 +16,13 @@ module Ask
16
16
  # A backend that fetched the page but found nothing usable in it.
17
17
  class EmptyContentError < Error; end
18
18
 
19
+ # A backend that fetched a REGISTRAR PARKING PAGE — an ad for a
20
+ # parked (for-sale) domain, not the site's content. Deterministic and
21
+ # terminal: retrying will never turn a parking ad into content, so
22
+ # the pipeline must classify (not retry) it. A subclass of
23
+ # EmptyContentError so existing empty-content handling still applies.
24
+ class ParkedDomainError < EmptyContentError; end
25
+
19
26
  # Network-level failure — timeout, connection refused/reset, bad
20
27
  # socket. Transient: the same URL may succeed on retry.
21
28
  class TimeoutError < Error; end
@@ -201,8 +201,9 @@ module Ask
201
201
  end
202
202
  # Browser renders the parked page a JS redirect lands on (the
203
203
  # server shell hands /lander to JS) — Local never sees it. The
204
- # shared parked-domain detector catches it here.
205
- raise EmptyContentError, "parked domain at #{url} registrar parking page, not site content" if parked_domain?(body)
204
+ # shared parked-domain detector catches it here; the distinct
205
+ # ParkedDomainError lets the pipeline classify (never retry) it.
206
+ raise ParkedDomainError, "parked domain at #{url} — registrar parking page, not site content" if parked_domain?(body)
206
207
 
207
208
  result = Markdown.generate(body, base_url: url, filter: self.class.content_filter)
208
209
  result[:outlinks] = outlink_urls(body, url)
@@ -55,7 +55,7 @@ module Ask
55
55
  # parked pages are fully server-rendered, so both Local and
56
56
  # Browser see the same ad.
57
57
  if parked_domain?(body)
58
- raise EmptyContentError, "parked domain at #{url} — registrar parking page, not site content"
58
+ raise ParkedDomainError, "parked domain at #{url} — registrar parking page, not site content"
59
59
  end
60
60
  raise EmptyContentError, "no readable content at #{url}" unless usable_content?(page[:content])
61
61
  # The completeness signal: a JS-app shell whose server HTML
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module WebFetch
5
- VERSION = '0.5.8'
5
+ VERSION = '0.5.9'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-web-fetch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto