sdr-client 0.3.0 → 0.3.1

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: 80a6d11a266d546eb1e0763b99b13b18d9f64c558ef21db50f3f509623a4f4bf
4
- data.tar.gz: 5ec2344617583af3322f0426e39328aee355ee4c12d7338d8734f529110e8da6
3
+ metadata.gz: 4c634551367640a9eb3647e55fcac169a61b40af1a111582d3e857bc2cc1f020
4
+ data.tar.gz: 75f3a024adf97dad2cf85a8e8b117a232c71b2f644655b98752c1320af005e17
5
5
  SHA512:
6
- metadata.gz: 3a145ef20a1c42abaed33ab79746778844e922b530a6c48d1b7f6d6f50a0e5a2c3f23e15a804fc5b75b3baeaac6baa4e67b35391965b5bb5da34892b345c9805
7
- data.tar.gz: 2600c209c4f35f2ab7a8d7209189c690ec8f06de819666fd7bdd38f63290b997aa87355d54c7a5b5b2e4633ecfd02f75e908815923c2f44116373a999789bf68
6
+ metadata.gz: 04a14d2edbb8334fbcc13b7ae131d7bf1697869c580395c2ea8c2971c18b911d55b7b0128e0cdff25b7a5844333f11eb2af23bc435ab7c6e692e4951092e22ed
7
+ data.tar.gz: 6c3369f015d8e3201ba1f58664c4d9b15208064eb5fdd24deca2de26ae7d4575889d22f7aa25eacb2e1232cfd2068d288771c6ba0c04737b7e5fc6c7508d2ba8
@@ -4,7 +4,8 @@ module SdrClient
4
4
  module Deposit
5
5
  # This represents the FileSet metadata that we send to the server for doing a deposit
6
6
  class FileSet
7
- def initialize(uploads: [], files: [])
7
+ def initialize(uploads: [], files: [], label:)
8
+ @label = label
8
9
  @files = if !uploads.empty?
9
10
  uploads.map do |upload|
10
11
  File.new(external_identifier: upload.signed_id, label: upload.filename, filename: upload.filename)
@@ -17,6 +18,7 @@ module SdrClient
17
18
  def as_json
18
19
  {
19
20
  "type": 'http://cocina.sul.stanford.edu/models/fileset.jsonld',
21
+ "label": label,
20
22
  structural: {
21
23
  hasMember: files.map(&:as_json)
22
24
  }
@@ -25,7 +27,7 @@ module SdrClient
25
27
 
26
28
  private
27
29
 
28
- attr_reader :files
30
+ attr_reader :files, :label
29
31
  end
30
32
  end
31
33
  end
@@ -38,7 +38,9 @@ module SdrClient
38
38
  # @param [Array<SdrClient::Deposit::Files::DirectUploadResponse>] uploads the uploaded files to attach.
39
39
  # @return [Request] a clone of this request with the uploads added
40
40
  def with_uploads(uploads)
41
- file_sets = uploads.map { |upload| FileSet.new(uploads: [upload]) }
41
+ file_sets = uploads.each_with_index.map do |upload, i|
42
+ FileSet.new(uploads: [upload], label: "Object #{i + 1}")
43
+ end
42
44
 
43
45
  Request.new(label: label,
44
46
  apo: apo,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SdrClient
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdr-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne