sdr-client 0.91.0 → 0.94.0

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: f8233c4bc5f385175264ff828603971ecf6f0e65e5ed5d973ce8eed2bf42be8e
4
- data.tar.gz: 63cbe0407ada26d325730ad992a74964ae83cc3390a2a2ccd3b446b070c78969
3
+ metadata.gz: 803573f6b3fd95009062083305ecae6b1cd7aa673542c4323eccf1a1ffd5e111
4
+ data.tar.gz: 3169e6f1c5cc8ef6157bbd3cb7dff82aa35f2e2cc1e920ee4fead78bee56b5aa
5
5
  SHA512:
6
- metadata.gz: 3b7fa91c363c8d88d53f168e17e9627cb773bdea6d51c2e3891e1ed5fdbcd57db731e9f021e7edc40b2426834e3d1c962627769126d605ba1f99134069dcdbb7
7
- data.tar.gz: fbdbc1fafad4c9c1a47379fe697b8573b44cbd368b4a76ccdb7998898a93c3e9898286c8abf4b46326bd1c30ceed9ea1608fb3ba748e5cc44bb4415b8bb4581a
6
+ metadata.gz: 6055e3448f616c954db166a3292a40e1becdb3d43c588e5d66d34855d207623901a04bca1f19702ecce1162ee305efd6d42d80347f62db69de18720b0ea55988
7
+ data.tar.gz: 3195d9440212b3a460f6a1950341908a734d7053d94c75a36528730bcb09b53c0fc029090277d08a31c41859f80ba81e280f0fd92fe1c4e916972824ab823cda
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:
@@ -175,3 +175,10 @@ RSpec/Capybara/SpecificMatcher: # new in 2.12
175
175
  Enabled: true
176
176
  RSpec/Rails/HaveHttpStatus: # new in 2.12
177
177
  Enabled: true
178
+
179
+ Lint/RequireRangeParentheses: # new in 1.32
180
+ Enabled: true
181
+ Style/EmptyHeredoc: # new in 1.32
182
+ Enabled: true
183
+ Style/MagicCommentFormat: # new in 1.35
184
+ Enabled: true
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,26 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sdr-client (0.91.0)
4
+ sdr-client (0.94.0)
5
5
  activesupport
6
- cocina-models (~> 0.83.0)
6
+ cocina-models (~> 0.84.0)
7
7
  dry-monads
8
8
  faraday (>= 0.16)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (7.0.3.1)
13
+ activesupport (7.0.4)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
15
  i18n (>= 1.6, < 2)
16
16
  minitest (>= 5.1)
17
17
  tzinfo (~> 2.0)
18
- addressable (2.8.0)
19
- public_suffix (>= 2.0.2, < 5.0)
18
+ addressable (2.8.1)
19
+ public_suffix (>= 2.0.2, < 6.0)
20
20
  ast (2.4.2)
21
21
  attr_extras (6.2.5)
22
22
  byebug (11.1.3)
23
- cocina-models (0.83.0)
23
+ cocina-models (0.84.4)
24
24
  activesupport
25
25
  deprecation
26
26
  dry-struct (~> 1.0)
@@ -79,14 +79,12 @@ GEM
79
79
  json (2.6.2)
80
80
  jsonpath (1.1.2)
81
81
  multi_json
82
- mini_portile2 (2.8.0)
83
- minitest (5.16.2)
82
+ minitest (5.16.3)
84
83
  multi_json (1.15.0)
85
- nokogiri (1.13.8)
86
- mini_portile2 (~> 2.8.0)
87
- racc (~> 1.4)
88
84
  nokogiri (1.13.8-x86_64-darwin)
89
85
  racc (~> 1.4)
86
+ nokogiri (1.13.8-x86_64-linux)
87
+ racc (~> 1.4)
90
88
  openapi3_parser (0.9.2)
91
89
  commonmarker (~> 0.17)
92
90
  openapi_parser (0.15.0)
@@ -96,7 +94,7 @@ GEM
96
94
  ast (~> 2.4.1)
97
95
  patience_diff (1.2.0)
98
96
  optimist (~> 3.0)
99
- public_suffix (4.0.7)
97
+ public_suffix (5.0.0)
100
98
  racc (1.6.0)
101
99
  rainbow (3.1.1)
102
100
  rake (13.0.6)
@@ -119,7 +117,7 @@ GEM
119
117
  rspec-core (>= 2, < 4, != 2.12.0)
120
118
  rss (0.2.9)
121
119
  rexml
122
- rubocop (1.35.0)
120
+ rubocop (1.36.0)
123
121
  json (~> 2.3)
124
122
  parallel (~> 1.10)
125
123
  parser (>= 3.1.2.1)
@@ -151,13 +149,14 @@ GEM
151
149
  tzinfo (2.0.5)
152
150
  concurrent-ruby (~> 1.0)
153
151
  unicode-display_width (2.2.0)
154
- webmock (3.17.1)
152
+ webmock (3.18.1)
155
153
  addressable (>= 2.8.0)
156
154
  crack (>= 0.3.2)
157
155
  hashdiff (>= 0.4.0, < 2.0.0)
158
156
  zeitwerk (2.6.0)
159
157
 
160
158
  PLATFORMS
159
+ x86_64-darwin-19
161
160
  x86_64-darwin-21
162
161
  x86_64-linux
163
162
 
@@ -24,7 +24,7 @@ module SdrClient
24
24
  def self.updated_structural(structural, signed_ids)
25
25
  structural[:contains].each do |file_set|
26
26
  file_set[:structural][:contains].each do |file|
27
- file[:externalIdentifier] = signed_ids[file[:filename]]
27
+ file[:externalIdentifier] = signed_ids[file[:filename]] if signed_ids.key?(file[:filename])
28
28
  end
29
29
  end
30
30
  structural
@@ -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.91.0'
4
+ VERSION = '0.94.0'
5
5
  end
data/sdr-client.gemspec CHANGED
@@ -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.83.0'
31
+ spec.add_dependency 'cocina-models', '~> 0.84.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.91.0
4
+ version: 0.94.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-17 00:00:00.000000000 Z
11
+ date: 2022-09-10 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.83.0
33
+ version: 0.84.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.83.0
40
+ version: 0.84.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dry-monads
43
43
  requirement: !ruby/object:Gem::Requirement