sdr-client 0.67.0 → 0.67.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e08558986780410f688c1c5f19396dd7a55065281ec47e5e1c2f4f5a09d64618
|
4
|
+
data.tar.gz: 0a6f0a072b0543de5ba731552340d52b8bd2dcc9414be96ee69f5709aa496471
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e4f1efe21eaf7938d0a6533d5de35f5a31bbd470a14120036c6991ebdaf3d17885e958861191e49c9f4548d7e61be840e2e94fd1957594515ff19af439b5f4c
|
7
|
+
data.tar.gz: 648509578100d2728172a1644ba8dcc3e60e4489cc82860fca33264d9bbb037e2f8b6699a1b351f87eb87697c330899b19190746c16c611dc05ffeb1aac8f7a4
|
@@ -10,6 +10,7 @@ module SdrClient
|
|
10
10
|
# @param [Class] grouping_strategy class whose run method groups an array of uploads
|
11
11
|
# Additional metadata includes access, preserve, shelve, publish, md5, sha1
|
12
12
|
# @param [Logger] logger the logger to use
|
13
|
+
# @param [Class] file_set_type_strategy class whose run method determines file_set type
|
13
14
|
def initialize(metadata:, grouping_strategy:, logger:, file_set_type_strategy: FileTypeFileSetStrategy)
|
14
15
|
@metadata = metadata
|
15
16
|
@logger = logger
|
@@ -10,6 +10,7 @@ module SdrClient
|
|
10
10
|
# @param [String] connection the server connection to use
|
11
11
|
# @param [Boolean] accession should the accessionWF be started
|
12
12
|
# @param [Class] grouping_strategy class whose run method groups an array of uploads
|
13
|
+
# @param [Class] file_set_type_strategy class whose run method determines file_set type
|
13
14
|
# @param [Array<String>] files a list of file names to upload
|
14
15
|
# @param [Boolean] assign_doi should a DOI be assigned to this item
|
15
16
|
# @param [Logger] logger the logger to use
|
@@ -19,6 +20,7 @@ module SdrClient
|
|
19
20
|
connection:,
|
20
21
|
accession:,
|
21
22
|
grouping_strategy: SingleFileGroupingStrategy,
|
23
|
+
file_set_type_strategy: FileTypeFileSetStrategy,
|
22
24
|
files: [],
|
23
25
|
assign_doi: false,
|
24
26
|
logger: Logger.new($stdout))
|
@@ -27,6 +29,7 @@ module SdrClient
|
|
27
29
|
@metadata = metadata
|
28
30
|
@logger = logger
|
29
31
|
@grouping_strategy = grouping_strategy
|
32
|
+
@file_set_type_strategy = file_set_type_strategy
|
30
33
|
@accession = accession
|
31
34
|
@assign_doi = assign_doi
|
32
35
|
end
|
@@ -43,6 +46,7 @@ module SdrClient
|
|
43
46
|
connection: connection)
|
44
47
|
metadata_builder = MetadataBuilder.new(metadata: metadata,
|
45
48
|
grouping_strategy: grouping_strategy,
|
49
|
+
file_set_type_strategy: file_set_type_strategy,
|
46
50
|
logger: logger)
|
47
51
|
request = metadata_builder.with_uploads(upload_responses)
|
48
52
|
model = Cocina::Models.build_request(request.as_json.with_indifferent_access)
|
@@ -56,7 +60,7 @@ module SdrClient
|
|
56
60
|
|
57
61
|
private
|
58
62
|
|
59
|
-
attr_reader :metadata, :files, :connection, :logger, :grouping_strategy
|
63
|
+
attr_reader :metadata, :files, :connection, :logger, :grouping_strategy, :file_set_type_strategy
|
60
64
|
|
61
65
|
def check_files_exist
|
62
66
|
logger.info('checking to see if files exist')
|
data/lib/sdr_client/deposit.rb
CHANGED
@@ -28,6 +28,7 @@ module SdrClient
|
|
28
28
|
files_metadata: {},
|
29
29
|
accession: false,
|
30
30
|
grouping_strategy: SingleFileGroupingStrategy,
|
31
|
+
file_set_type_strategy: FileTypeFileSetStrategy,
|
31
32
|
logger: Logger.new($stdout))
|
32
33
|
augmented_metadata = FileMetadataBuilder.build(files: files, files_metadata: files_metadata)
|
33
34
|
metadata = Request.new(label: label,
|
@@ -48,6 +49,7 @@ module SdrClient
|
|
48
49
|
connection = Connection.new(url: url)
|
49
50
|
Process.new(metadata: metadata, connection: connection, files: files,
|
50
51
|
grouping_strategy: grouping_strategy,
|
52
|
+
file_set_type_strategy: file_set_type_strategy,
|
51
53
|
accession: accession,
|
52
54
|
logger: logger).run
|
53
55
|
end
|
data/lib/sdr_client/version.rb
CHANGED