preservation-client 0.4.0 → 0.5.0

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: 4c390947fedbff620ee7ff2afa122451db405591f54fae1c1772bbcb80b563fc
4
- data.tar.gz: 180421d85a8c49b9a32d9d7ca4de3d57c186451d3097a8dd4c6d4044f96ce1f1
3
+ metadata.gz: 05d036c5889b48b53bcd21a9d86edbbcb1bfe0dee6664532d52ae4358ccb4253
4
+ data.tar.gz: 1f69f80a51334169011dbff4b2f612465d12733f38c0ba064ec1eee9d030bfc9
5
5
  SHA512:
6
- metadata.gz: b95502f28aecd1f92bb58a1b4c61910f7bbd2eca0f4afab19a8c7b1610f2a4f42245dbf6a2eda9e6e0ab7fd1e15f5076ad4a862f7d7d53e89b10dca57d421789
7
- data.tar.gz: 2bd69f1bbe51930ebac3bb02629cc1053e807ab36c73b5c1aa62f737cba104eed3a3457d154cc41e9d44a40c448fcea9edfe1d953048ade738014b6a158ef314
6
+ metadata.gz: 0b48324d321045fd466bf52a766dea050ea0cb82bfef4d5456bea54fd80e48d917ea698e5d3729628c7d004fba90b8425dc383f741b0d376e96de1d99904571c
7
+ data.tar.gz: c23a295b93adc88877a125535c21126c865462bc49a6241e8f7511feb0fd6b4fb6e79e3f7af6f6a574e472bcdc82a9a085ad187e931e66638dab3887e04fba95
data/README.md CHANGED
@@ -67,7 +67,8 @@ druids may be with or without the "druid:" prefix - 'oo000oo0000' or 'druid:oo00
67
67
  - `client.objects.metadata(druid: 'oo000oo0000', filepath: 'identityMetadata.xml')` - returns contents of identityMetadata.xml in most recent version of Moab object
68
68
  - You may specify the version:
69
69
  - `client.objects.metadata(druid: 'oo000oo0000', filepath: 'identityMetadata.xml', version: '8')` - returns contents of identityMetadata.xml in version 8 of Moab object
70
- - `client.objects.signature_catalog(druid: 'oo000oo0000')` - returns contents of latest version of signatureCatalog.xml from Moab object
70
+ - `client.objects.signature_catalog('oo000oo0000')` - returns latest Moab::SignatureCatalog from Moab, or new Moab::SignatureCatalog for Moab if none yet exists
71
+
71
72
 
72
73
  ### Get difference information between passed contentMetadata.xml and files in the Moab
73
74
 
@@ -70,10 +70,17 @@ module Preservation
70
70
  file(druid, 'metadata', filepath, version)
71
71
  end
72
72
 
73
- # convenience method for retrieving latest signatureCatalog.xml file from a Moab object
73
+ # convenience method for retrieving latest Moab::SignatureCatalog from a Moab object,
74
+ # or a newly minted Moab::SignatureCatalog if it doesn't yet exist
74
75
  # @param [String] druid - with or without prefix: 'druid:ab123cd4567' OR 'ab123cd4567'
76
+ # @return [Moab::SignatureCatalog] the catalog of all files previously ingested
75
77
  def signature_catalog(druid)
76
- manifest(druid: druid, filepath: 'signatureCatalog.xml')
78
+ Moab::SignatureCatalog.parse manifest(druid: druid, filepath: 'signatureCatalog.xml')
79
+ rescue Preservation::Client::UnexpectedResponseError => e
80
+ return Moab::SignatureCatalog.new(digital_object_id: druid, version_id: 0) if
81
+ e.message.match?('404 File Not Found')
82
+
83
+ raise
77
84
  end
78
85
 
79
86
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Preservation
4
4
  class Client
5
- VERSION = '0.4.0'
5
+ VERSION = '0.5.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preservation-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naomi Dushay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-06 00:00:00.000000000 Z
11
+ date: 2019-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport