sdr-client 0.6.0 → 0.7.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb3f20e21233ef1ef0f4d72f4d7dcd0e4bb52968b955152e62259e023b730b7b
|
4
|
+
data.tar.gz: ecbb08752fcd3c71b4868404bc48871eaba138c852304678a466cd85de3fe4bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08307c141dd01737019f40e1a999b8fd9aa41abca57379f655a9ac5773eba55f974c4d3c34c804e44cd7c8a8792c292e84f5d8c7bf62dd2021b32dd87832420b'
|
7
|
+
data.tar.gz: 928ba2d1377cf11bc1e1cfaff2891748ac916d3a3d9e83fca0ac07e0efdbd450ceb895a066bcc3c3a7a4355f186717efb4f5c4d6540867336a21095064f02cb2
|
data/lib/sdr_client/deposit.rb
CHANGED
@@ -12,6 +12,7 @@ module SdrClient
|
|
12
12
|
source_id:,
|
13
13
|
url:,
|
14
14
|
files: [],
|
15
|
+
files_metadata: {},
|
15
16
|
grouping_strategy: SingleFileGroupingStrategy)
|
16
17
|
token = Credentials.read
|
17
18
|
|
@@ -21,7 +22,8 @@ module SdrClient
|
|
21
22
|
collection: collection,
|
22
23
|
source_id: source_id,
|
23
24
|
catkey: catkey)
|
24
|
-
Process.new(metadata: metadata, url: url, token: token,
|
25
|
+
Process.new(metadata: metadata, url: url, token: token,
|
26
|
+
files: files, files_metadata: files_metadata, grouping_strategy: grouping_strategy).run
|
25
27
|
end
|
26
28
|
# rubocop:enable Metrics/ParameterLists
|
27
29
|
end
|
@@ -7,7 +7,10 @@ module SdrClient
|
|
7
7
|
# @param [Array<SdrClient::Deposit::Files::DirectUploadResponse>] uploads the uploaded files to attach.
|
8
8
|
# @return [Array<Array<SdrClient::Deposit::Files::DirectUploadResponse>>] uploads the grouped uploaded files.
|
9
9
|
def self.run(uploads: [])
|
10
|
-
|
10
|
+
# Call `#values` on the result of the grouping operation because 1)
|
11
|
+
# `Process#build_filesets` expects an array of arrays, not an array of
|
12
|
+
# hashes, and 2) the keys aren't used anywhere
|
13
|
+
uploads.group_by { |ul| ::File.basename(ul.filename, '.*') }.values
|
11
14
|
end
|
12
15
|
end
|
13
16
|
end
|
@@ -126,10 +126,10 @@ module SdrClient
|
|
126
126
|
# @return [Array<SdrClient::Deposit::FileSet>] the uploads transformed to filesets
|
127
127
|
def build_filesets(uploads:, files_metadata:)
|
128
128
|
grouped_uploads = grouping_strategy.run(uploads: uploads)
|
129
|
-
grouped_uploads.
|
129
|
+
grouped_uploads.map.with_index(1) do |upload_group, i|
|
130
130
|
metadata_group = {}
|
131
131
|
upload_group.each { |upload| metadata_group[upload.filename] = files_metadata.fetch(upload.filename, {}) }
|
132
|
-
FileSet.new(uploads: upload_group, uploads_metadata: metadata_group, label: "Object #{i
|
132
|
+
FileSet.new(uploads: upload_group, uploads_metadata: metadata_group, label: "Object #{i}")
|
133
133
|
end
|
134
134
|
end
|
135
135
|
end
|
data/lib/sdr_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sdr-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-monads
|
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
196
|
- !ruby/object:Gem::Version
|
197
197
|
version: '0'
|
198
198
|
requirements: []
|
199
|
-
rubygems_version: 3.
|
199
|
+
rubygems_version: 3.1.2
|
200
200
|
signing_key:
|
201
201
|
specification_version: 4
|
202
202
|
summary: The CLI for https://github.com/sul-dlss/sdr-api
|