sdr-client 0.30.0 → 0.35.0

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: b0d1d43ce2ed3ec6f15f5ded1df495feb3f9cb102ab15f301de262d3baf52b5d
4
- data.tar.gz: 23fde50afe76323b9ce1bf0cb1c210c01375c14644ff1896d57f41d2b4669328
3
+ metadata.gz: 9dc1a5e250f629304c866debec189a4a427d9d74fbfdf4fb62cdad35eff195e5
4
+ data.tar.gz: 3b5b553cee20aebba9048bedc8c539a5305b2e01f9ee299861c0ee42f33b6936
5
5
  SHA512:
6
- metadata.gz: 123a61ac4a8fdeccbfa46e37156414c101375a7fc9a15b4518e54919cd4d3aae41ff5b79da9a74ccfd845f57d9f55206a1568c4968bef5406ee369271bc4c929
7
- data.tar.gz: da97cc45d1ed3541bad24adc9c2694b89264dedeca704614e9bbbd1c0bf213abd2faecab464c6cff53e07568d01ec42eadf7ada14c84a4d7754e170ba33c71a0
6
+ metadata.gz: ddafb6fddae01c1040dc486284f846ab93677959fc2a55b2b8db2e52ef5e7e8cb18a1a3266c1bc256835ec29a9e23426e3c6b5470fcdd74b61f62e3e37f3b7e4
7
+ data.tar.gz: 07e9c70565c0bf2c925ad8378c31d4d31604cc9f6d908f26cc088deb6fc2a59239c112b1f11b7e2be0cc0c2beff70e5e02af5a3015ef0b908c1043e48cfa2151
@@ -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.30.0'
4
+ VERSION = '0.35.0'
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.36.0'
31
+ spec.add_dependency 'cocina-models', '~> 0.42.0'
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.30.0
4
+ version: 0.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-20 00:00:00.000000000 Z
11
+ date: 2020-10-22 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.36.0
33
+ version: 0.42.0
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.36.0
40
+ version: 0.42.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dry-monads
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -219,7 +219,7 @@ metadata:
219
219
  homepage_uri: https://github.com/sul-dlss/sdr-client
220
220
  source_code_uri: https://github.com/sul-dlss/sdr-client
221
221
  changelog_uri: https://github.com/sul-dlss/sdr-client/releases
222
- post_install_message:
222
+ post_install_message:
223
223
  rdoc_options: []
224
224
  require_paths:
225
225
  - lib
@@ -235,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
235
  version: '0'
236
236
  requirements: []
237
237
  rubygems_version: 3.1.2
238
- signing_key:
238
+ signing_key:
239
239
  specification_version: 4
240
240
  summary: The CLI for https://github.com/sul-dlss/sdr-api
241
241
  test_files: []