sdr-client 0.92.0 → 0.93.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: fee9fbecfa4695a631a2f394c5d1e0e78c03d68f163396c0c0acd8143395e78f
4
- data.tar.gz: 899126bbd0faf0fee91291aca8e4b525c1e7f5b8e4c0bb83d071ca8d6c0a480e
3
+ metadata.gz: 3465a94659b904cef1659451b8df5c37aafab2603f5d90797ad7b2650e7edc0b
4
+ data.tar.gz: 6a9a8dbf0e1e0087d25a8e73678c6c0eb0eb2cab7a594a0a5592fae6972563e0
5
5
  SHA512:
6
- metadata.gz: 5fe352e6c87e3b219fe5859d5597bf87722513e01099fa3dea27e345f4294a59400a01fbc1b49b3175ac6ee3538e056c792ed79836d862302793e08efdaf150c
7
- data.tar.gz: 0ecc1e7dc161748587f48c8f2f4ea1a9590d65d89277a1701d89a1cb1042ba447088a976e5f6f43940fa808002fd479a0948770147ee1eea7259b96f60bcc19d
6
+ metadata.gz: 9c27c0b7cd9b61ae548e93d086778ec9d94b512ac3f21378f457cc4c651fa9381efba7c3e0b55708e3a2b1333409334ed70c9bcb68168cf2300fa7a8355fc1cf
7
+ data.tar.gz: 50a8908d7d3e445594655612a0b4d0aa28098d03c666c62cb2ff3040a3a9b3912a988e35a97abb91ac0d5ea67d4dbd1b4c82d1f99a357b102b54006c9e1ce1d8
data/.rubocop.yml CHANGED
@@ -14,7 +14,7 @@ Metrics/BlockLength:
14
14
  Exclude:
15
15
  - 'spec/**/*'
16
16
  - 'sdr-client.gemspec'
17
- IgnoredMethods:
17
+ AllowedMethods:
18
18
  - 'OptionParser.new'
19
19
 
20
20
  Metrics/ClassLength:
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config --auto-gen-only-exclude`
3
- # on 2022-05-05 05:53:08 UTC using RuboCop version 1.28.2.
3
+ # on 2022-09-08 16:31:29 UTC using RuboCop version 1.36.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
@@ -19,7 +19,7 @@ Lint/NoReturnInBeginEndBlocks:
19
19
  - 'lib/sdr_client/deposit/model_process.rb'
20
20
 
21
21
  # Offense count: 2
22
- # This cop supports safe auto-correction (--auto-correct).
22
+ # This cop supports safe autocorrection (--autocorrect).
23
23
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
24
24
  Lint/UnusedMethodArgument:
25
25
  Exclude:
@@ -27,20 +27,20 @@ Lint/UnusedMethodArgument:
27
27
  - 'lib/sdr_client/deposit/image_file_set_strategy.rb'
28
28
 
29
29
  # Offense count: 4
30
- # Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max.
30
+ # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes, Max.
31
31
  Metrics/AbcSize:
32
32
  Exclude:
33
33
  - 'lib/sdr_client/cli.rb'
34
34
  - 'lib/sdr_client/update.rb'
35
35
 
36
36
  # Offense count: 1
37
- # Configuration parameters: IgnoredMethods, Max.
37
+ # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, Max.
38
38
  Metrics/CyclomaticComplexity:
39
39
  Exclude:
40
40
  - 'lib/sdr_client/update.rb'
41
41
 
42
42
  # Offense count: 12
43
- # Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
43
+ # Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
44
44
  Metrics/MethodLength:
45
45
  Exclude:
46
46
  - 'lib/sdr_client/cli.rb'
@@ -59,13 +59,12 @@ RSpec/ExampleLength:
59
59
  - 'spec/sdr_client/model_deposit_spec.rb'
60
60
  - 'spec/sdr_client/update_spec.rb'
61
61
 
62
- # Offense count: 3
62
+ # Offense count: 2
63
63
  # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
64
64
  # Include: **/*_spec*rb*, **/spec/**/*
65
65
  RSpec/FilePath:
66
66
  Exclude:
67
67
  - 'spec/sdr_client/client_spec.rb'
68
- - 'spec/sdr_client/deposit/find_spec.rb'
69
68
  - 'spec/sdr_client/model_deposit_spec.rb'
70
69
 
71
70
  # Offense count: 1
@@ -75,17 +74,18 @@ RSpec/MessageSpies:
75
74
  Exclude:
76
75
  - 'spec/sdr_client/deposit_spec.rb'
77
76
 
78
- # Offense count: 12
77
+ # Offense count: 13
79
78
  # Configuration parameters: Max.
80
79
  RSpec/MultipleExpectations:
81
80
  Exclude:
82
81
  - 'spec/sdr_client/connection_spec.rb'
83
82
  - 'spec/sdr_client/deposit/metadata_builder_spec.rb'
84
83
  - 'spec/sdr_client/deposit_spec.rb'
84
+ - 'spec/sdr_client/find_spec.rb'
85
85
  - 'spec/sdr_client/login_spec.rb'
86
86
  - 'spec/sdr_client/model_deposit_spec.rb'
87
87
 
88
- # Offense count: 32
88
+ # Offense count: 36
89
89
  # Configuration parameters: AllowSubject, Max.
90
90
  RSpec/MultipleMemoizedHelpers:
91
91
  Exclude:
@@ -106,7 +106,7 @@ RSpec/NamedSubject:
106
106
  - 'spec/sdr_client/deposit/process_spec.rb'
107
107
  - 'spec/sdr_client/login_spec.rb'
108
108
 
109
- # Offense count: 16
109
+ # Offense count: 19
110
110
  # Configuration parameters: Max.
111
111
  RSpec/NestedGroups:
112
112
  Exclude:
@@ -117,28 +117,28 @@ RSpec/NestedGroups:
117
117
  - 'spec/sdr_client/update_spec.rb'
118
118
 
119
119
  # Offense count: 19
120
- # This cop supports safe auto-correction (--auto-correct).
120
+ # This cop supports safe autocorrection (--autocorrect).
121
121
  Style/KeywordParametersOrder:
122
122
  Exclude:
123
123
  - 'lib/sdr_client/deposit.rb'
124
124
  - 'lib/sdr_client/deposit/request.rb'
125
125
 
126
126
  # Offense count: 1
127
- # This cop supports safe auto-correction (--auto-correct).
127
+ # This cop supports safe autocorrection (--autocorrect).
128
128
  Style/MultilineTernaryOperator:
129
129
  Exclude:
130
130
  - 'lib/sdr_client/update.rb'
131
131
 
132
132
  # Offense count: 2
133
- # This cop supports unsafe auto-correction (--auto-correct-all).
133
+ # This cop supports unsafe autocorrection (--autocorrect-all).
134
134
  # Configuration parameters: Mode.
135
135
  Style/StringConcatenation:
136
136
  Exclude:
137
137
  - 'lib/sdr_client/deposit/create_resource.rb'
138
138
  - 'spec/sdr_client/deposit_spec.rb'
139
139
 
140
- # Offense count: 29
141
- # This cop supports safe auto-correction (--auto-correct).
140
+ # Offense count: 33
141
+ # This cop supports safe autocorrection (--autocorrect).
142
142
  # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
143
143
  # URISchemes: http, https
144
144
  Layout/LineLength:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sdr-client (0.91.0)
4
+ sdr-client (0.92.0)
5
5
  activesupport
6
6
  cocina-models (~> 0.84.0)
7
7
  dry-monads
@@ -20,7 +20,7 @@ GEM
20
20
  ast (2.4.2)
21
21
  attr_extras (6.2.5)
22
22
  byebug (11.1.3)
23
- cocina-models (0.84.0)
23
+ cocina-models (0.84.4)
24
24
  activesupport
25
25
  deprecation
26
26
  dry-struct (~> 1.0)
@@ -117,7 +117,7 @@ GEM
117
117
  rspec-core (>= 2, < 4, != 2.12.0)
118
118
  rss (0.2.9)
119
119
  rexml
120
- rubocop (1.35.1)
120
+ rubocop (1.36.0)
121
121
  json (~> 2.3)
122
122
  parallel (~> 1.10)
123
123
  parser (>= 3.1.2.1)
@@ -6,6 +6,11 @@ module SdrClient
6
6
  # The namespace for the "get" command
7
7
  module Find
8
8
  DRO_PATH = '/v1/resources/%<id>s'
9
+
10
+ # Raised when find returns an unsuccessful response
11
+ class Failed < StandardError; end
12
+
13
+ # @raise [Failed] if the find operation fails
9
14
  # @return [String] JSON for the given Cocina object or an error
10
15
  def self.run(druid, url:, logger: Logger.new($stdout))
11
16
  connection = Connection.new(url: url)
@@ -13,7 +18,9 @@ module SdrClient
13
18
  logger.info("Retrieving metadata from: #{path}")
14
19
  response = connection.get(path)
15
20
  unless response.success?
16
- logger.error("There was an HTTP #{response.status} error making the request: #{response.body}")
21
+ error_message = "There was an HTTP #{response.status} error making the request: #{response.body}"
22
+ logger.error(error_message)
23
+ raise Failed, error_message
17
24
  end
18
25
  response.body
19
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SdrClient
4
- VERSION = '0.92.0'
4
+ VERSION = '0.93.0'
5
5
  end
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.92.0
4
+ version: 0.93.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: 2022-08-23 00:00:00.000000000 Z
11
+ date: 2022-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -259,7 +259,7 @@ metadata:
259
259
  source_code_uri: https://github.com/sul-dlss/sdr-client
260
260
  changelog_uri: https://github.com/sul-dlss/sdr-client/releases
261
261
  rubygems_mfa_required: 'true'
262
- post_install_message:
262
+ post_install_message:
263
263
  rdoc_options: []
264
264
  require_paths:
265
265
  - lib
@@ -275,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
275
275
  version: '0'
276
276
  requirements: []
277
277
  rubygems_version: 3.2.32
278
- signing_key:
278
+ signing_key:
279
279
  specification_version: 4
280
280
  summary: The CLI for https://github.com/sul-dlss/sdr-api
281
281
  test_files: []