sdr-client 0.16.0 → 0.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sdr_client/deposit.rb +2 -1
- data/lib/sdr_client/deposit/metadata_builder.rb +12 -1
- data/lib/sdr_client/deposit/request.rb +3 -1
- data/lib/sdr_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6d44bbb8b087e0045328a2b8625654ad9f7eaadf7c968c5ee5402683dc04d26
|
4
|
+
data.tar.gz: 9808626f7cad4548ccce883253245c80fc18fac9cd14353dcb008cb8c1cf365a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e14bf4032db046e886a7ef02cc1183fab23806bf0b450527ad8e33f396d3cac1f2d254644e9f9e2179d38c04d200a4cdf09eb07515aabf0e8a7a2c7ad9367fd1
|
7
|
+
data.tar.gz: 39e311b8bb036dd2abff468086103be8e55516b1490d219c4c34e5b68b0c80322af47efd0dcc198ee11e3e24e484d7d206102f20e415ccfa171abd7d61d6fde5
|
data/lib/sdr_client/deposit.rb
CHANGED
@@ -5,10 +5,11 @@ require 'logger'
|
|
5
5
|
module SdrClient
|
6
6
|
# The namespace for the "deposit" command
|
7
7
|
module Deposit
|
8
|
+
BOOK_TYPE = 'http://cocina.sul.stanford.edu/models/book.jsonld'
|
8
9
|
# rubocop:disable Metrics/ParameterLists
|
9
10
|
# rubocop:disable Metrics/MethodLength
|
10
11
|
def self.run(label: nil,
|
11
|
-
type:
|
12
|
+
type: BOOK_TYPE,
|
12
13
|
viewing_direction: nil,
|
13
14
|
access: 'dark',
|
14
15
|
use_statement: nil,
|
@@ -16,6 +16,8 @@ module SdrClient
|
|
16
16
|
@grouping_strategy = grouping_strategy
|
17
17
|
end
|
18
18
|
|
19
|
+
# @param [UploadFiles] upload_responses the uploaded file information
|
20
|
+
# @return [Request] the metadata with fileset information added in.
|
19
21
|
def with_uploads(upload_responses)
|
20
22
|
file_sets = build_filesets(uploads: upload_responses)
|
21
23
|
metadata.with_file_sets(file_sets)
|
@@ -32,7 +34,16 @@ module SdrClient
|
|
32
34
|
grouped_uploads.map.with_index(1) do |upload_group, i|
|
33
35
|
FileSet.new(uploads: upload_group,
|
34
36
|
uploads_metadata: metadata_group(upload_group),
|
35
|
-
label:
|
37
|
+
label: label(i))
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def label(index)
|
42
|
+
case metadata.type
|
43
|
+
when BOOK_TYPE
|
44
|
+
"Page #{index}"
|
45
|
+
else
|
46
|
+
"Object #{index}"
|
36
47
|
end
|
37
48
|
end
|
38
49
|
|
@@ -79,10 +79,12 @@ module SdrClient
|
|
79
79
|
files_metadata.fetch(filename, {})
|
80
80
|
end
|
81
81
|
|
82
|
+
attr_reader :type
|
83
|
+
|
82
84
|
private
|
83
85
|
|
84
86
|
attr_reader :access, :label, :file_sets, :source_id, :catkey, :apo, :collection,
|
85
|
-
:
|
87
|
+
:files_metadata, :embargo_release_date, :embargo_access,
|
86
88
|
:viewing_direction, :use_statement, :copyright
|
87
89
|
|
88
90
|
def administrative
|
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.16.
|
4
|
+
version: 0.16.1
|
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-03-
|
11
|
+
date: 2020-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-monads
|