sdr-client 0.31.0 → 0.35.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: 999f1fcad7c001083d1ddb061042209a6242dad60947d324386f800c426ef1d6
4
- data.tar.gz: 7f1b29ca7327f2eda0625c94e117844296932290446b9b3a90576e0307e93343
3
+ metadata.gz: 551ee50a8e581a8a0e7cadcffec518168ef2b0fbba5368520ffeaaa086ccb66e
4
+ data.tar.gz: 5ca9d3232ccfac283d09d68310c9c4fa3355943c90ef5d5bc911f3367bea5396
5
5
  SHA512:
6
- metadata.gz: a04232a0f3dea514c51d12d2ead86abf0bdbd536bd60a183e69b1bf989c63128385b6d805291f7be18e430bf30515a836fd21cfcf16a8ba6c7bd033a3c1ad20d
7
- data.tar.gz: f5f7ee090e48fd96a2a34fee00b18bd5b59c3c29ac8b600d7bdf2de7be0c30914b5df1a2daccea00115d1e003d26bf8d4f998397ddb4c5fc487d81b5dfe51d85
6
+ metadata.gz: fa183be1fd002a39f25816b3f990123b3a5324e87f26fda44115537d31aeeace1915f53ba45e4432760ba9e08089da9afcec7b96061fd96ea8108a7d6d0b2cf3
7
+ data.tar.gz: ee6b43d4d29222f0aaec528ff85e1e2c8c657c9c659fd8089bd105c634a94c59d14275501501af4707c929d9e16606f11b815b267be0d95073d8579e7b2055ea
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-06-24 17:02:25 -0700 using RuboCop version 0.79.0.
3
+ # on 2020-09-08 13:16:08 -0500 using RuboCop version 0.79.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -21,9 +21,9 @@ Style/IfUnlessModifier:
21
21
  Exclude:
22
22
  - 'exe/sdr'
23
23
 
24
- # Offense count: 187
24
+ # Offense count: 188
25
25
  # Cop supports --auto-correct.
26
26
  # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
27
27
  # URISchemes: http, https
28
28
  Layout/LineLength:
29
- Max: 1228
29
+ Max: 1230
@@ -73,7 +73,9 @@ module SdrClient
73
73
 
74
74
  # Map of filenames to request files
75
75
  def request_files
76
- @request_files ||=
76
+ @request_files ||= begin
77
+ return {} unless request_dro.structural
78
+
77
79
  Hash[
78
80
  request_dro.structural.contains.map do |file_set|
79
81
  file_set.structural.contains.map do |file|
@@ -81,21 +83,26 @@ module SdrClient
81
83
  end
82
84
  end.flatten(1)
83
85
  ]
86
+ end
84
87
  end
85
88
 
89
+ # rubocop:disable Metrics/AbcSize
86
90
  def with_external_identifiers(upload_responses)
87
91
  signed_id_map = Hash[upload_responses.map { |response| [response.filename, response.signed_id] }]
88
92
 
89
93
  # Manipulating request_dro as hash since immutable
90
94
  request_dro_hash = request_dro.to_h
91
- request_dro_hash[:structural][:contains].each do |file_set|
92
- file_set[:structural][:contains].each do |file|
93
- file[:externalIdentifier] = signed_id_map[file[:filename]]
95
+ if request_dro_hash[:structural]
96
+ request_dro_hash[:structural][:contains].each do |file_set|
97
+ file_set[:structural][:contains].each do |file|
98
+ file[:externalIdentifier] = signed_id_map[file[:filename]]
99
+ end
94
100
  end
95
101
  end
96
102
 
97
103
  Cocina::Models::RequestDRO.new(request_dro_hash)
98
104
  end
105
+ # rubocop:enable Metrics/AbcSize
99
106
  end
100
107
  end
101
108
  end
@@ -104,7 +104,7 @@ module SdrClient
104
104
 
105
105
  def structural
106
106
  {}.tap do |json|
107
- json[:isMemberOf] = collection if collection
107
+ json[:isMemberOf] = [collection] if collection
108
108
  json[:contains] = file_sets.map(&:as_json) unless file_sets.empty?
109
109
  json[:hasMemberOrders] = [{ viewingDirection: viewing_direction }] if viewing_direction
110
110
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SdrClient
4
- VERSION = '0.31.0'
4
+ VERSION = '0.35.1'
5
5
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ['lib']
29
29
 
30
30
  spec.add_dependency 'activesupport'
31
- spec.add_dependency 'cocina-models', '~> 0.37.0'
31
+ spec.add_dependency 'cocina-models', '~> 0.42.1'
32
32
  spec.add_dependency 'dry-monads'
33
33
  spec.add_dependency 'faraday', '>= 0.16'
34
34
 
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.31.0
4
+ version: 0.35.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-08-26 00:00:00.000000000 Z
11
+ date: 2020-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.37.0
33
+ version: 0.42.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.37.0
40
+ version: 0.42.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dry-monads
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  - !ruby/object:Gem::Version
235
235
  version: '0'
236
236
  requirements: []
237
- rubygems_version: 3.1.2
237
+ rubygems_version: 3.0.3
238
238
  signing_key:
239
239
  specification_version: 4
240
240
  summary: The CLI for https://github.com/sul-dlss/sdr-api