purl_fetcher-client 1.5.2 → 1.5.3

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: 6d52e033a93ce8e113f1d74cc9f30e78e3ba8b1dfb97014ac37b47d713bc3dcf
4
- data.tar.gz: 6f7efec5ab930e23572d9f2eed03c45ec620ddc93271f4358b2a423641abbeda
3
+ metadata.gz: 26e9001f37819798fcdd911a7a98778a60dcbb6d67eb1d9bdafc2fd4e9eeb757
4
+ data.tar.gz: f57db80c799b563e0b8e0863ea35b1ffcd54413373a3f645a4478ee6f8ee571b
5
5
  SHA512:
6
- metadata.gz: bec42596a113ca16234082c0655800ab610e97974342be1ea714ce2937dd3f51e2d5597632a38f51b5b1efa8ddc3bce6cb5be0cd6e2d5d2215665518e698b5b4
7
- data.tar.gz: d11740e467d917e3fddafaf746d0810abece79cd735a8e07db1f235284b804a54b935165d3e2064fb43089dbdbd993d8f9243bad8afc8b5cf071cce565fca666
6
+ metadata.gz: c177d00f8b223863246ed9641ddca70c53fe447d167b1e85ee32b13cff76ef8ee4ef91e21e21ebd6aea7b91544ecabbcab65f84232954e77c2294e0123f4f8e3
7
+ data.tar.gz: d19fe944a5839c3177e57a84fcf0241fcf2c92a13cd6a86467db22981340e65dd8c5f04452db890a510e6a78eede456dd879e9d9f80309648548c2ecc9cfcf82
@@ -5,6 +5,7 @@ module PurlFetcher
5
5
  # Delete an item from the purl-fetcher cache
6
6
  class Unpublish
7
7
  # @param [String] druid the identifier of the item
8
+ # @raise [Purl::Fetcher::Client::AlreadyDeletedResponseError] if the item is already deleted
8
9
  def self.unpublish(druid:)
9
10
  new(druid:).unpublish
10
11
  end
@@ -18,6 +19,7 @@ module PurlFetcher
18
19
  logger.debug("Starting a unpublish request for: #{druid}")
19
20
  response = client.delete(path:)
20
21
  logger.debug("Unpublish request complete")
22
+ response
21
23
  end
22
24
 
23
25
  private
@@ -1,5 +1,5 @@
1
1
  module PurlFetcher
2
2
  class Client
3
- VERSION = "1.5.2"
3
+ VERSION = "1.5.3"
4
4
  end
5
5
  end
@@ -27,6 +27,9 @@ module PurlFetcher
27
27
  # Raised when the response from the server indicates that the requested item is not found
28
28
  class NotFoundResponseError < ResponseError; end
29
29
 
30
+ # Raised when the response from the server indicates that the requested item is already deleted
31
+ class AlreadyDeletedResponseError < ResponseError; end
32
+
30
33
  include Singleton
31
34
  class << self
32
35
  def configure(url:, logger: default_logger, token: nil)
@@ -53,6 +56,7 @@ module PurlFetcher
53
56
  def delete(path:)
54
57
  response = connection.delete(path)
55
58
 
59
+ raise AlreadyDeletedResponseError, response.body if response.status == 409
56
60
  raise "unexpected response: #{response.status} #{response.body}" unless response.success?
57
61
 
58
62
  response.body
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: purl_fetcher-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-01 00:00:00.000000000 Z
11
+ date: 2024-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport