preservation-client 7.1.0 → 7.2.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: 36fb9768da13a43eecf5e4e7bd172f4c3416ee96476350b08f1a97eae98b62a3
4
- data.tar.gz: 3f2a39bbc970df659ee1b49aa3b7cef13af405d438c47c9e430c7aabfd7fd575
3
+ metadata.gz: a0ddf2ef6f8e254553fa58ad4365dbe832187e22c1e45953923d492177a45fb8
4
+ data.tar.gz: db159e384f0ad33da9789cba5bb8fb60dda3336e8a123115e444d5f2d2c498fc
5
5
  SHA512:
6
- metadata.gz: 58491e17ab30f18d0000c860c96490df43663909867d2f072728b98b001b23c8c828e2a7eb02f68efbcbdc85ae83d2ff21df81bbe83f1b1eb7200a263fe54056
7
- data.tar.gz: a4bd42e808ba8e69e78802281b797ccf1c5b650458a91d6a516fda4cf91d226ca736d5a860570592a5ce30aa756c9a6956f735febf8e7e1c1515e2f200c8d5c4
6
+ metadata.gz: a33370379e09b916f7a79603308871d4f362fd7f2ceb88f39609a2048d4980a776324d82989d636c7ed3bf265bf83e5ca83824435266bc4ba82bde18087535fa
7
+ data.tar.gz: f2222e97c86fc2f6a23c5a3baad9ab65a379e1c65bcf3a0f9326d2953a802f3f9adc8d6f53d44cfe017f4987585602ff2bae3f36d565148d25ae3111f33ddc26
data/.circleci/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby-rails: sul-dlss/ruby-rails@4.5.0
3
+ ruby-rails: sul-dlss/ruby-rails@4.6.0
4
4
  workflows:
5
5
  build:
6
6
  jobs:
@@ -9,4 +9,3 @@ workflows:
9
9
  - ruby-rails/test-gem:
10
10
  name: test
11
11
  context: dlss
12
- use-codecov: true
data/.rubocop.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
- require:
3
+ plugins:
4
4
  - rubocop-rspec
5
5
  - rubocop-rake
6
6
 
@@ -167,10 +167,6 @@ RSpec/IdenticalEqualityAssertion: # new in 2.4
167
167
  Enabled: true
168
168
  RSpec/SubjectDeclaration: # new in 2.5
169
169
  Enabled: true
170
- FactoryBot/SyntaxMethods: # new in 2.7
171
- Enabled: true
172
- RSpec/Rails/AvoidSetupHook: # new in 2.4
173
- Enabled: true
174
170
  Gemspec/DeprecatedAttributeAssignment: # new in 1.30
175
171
  Enabled: true
176
172
  Layout/LineContinuationLeadingSpace: # new in 1.31
@@ -216,13 +212,6 @@ RSpec/ClassCheck: # new in 2.13
216
212
  Enabled: true
217
213
  RSpec/NoExpectationExample: # new in 2.13
218
214
  Enabled: true
219
- Capybara/SpecificFinders: # new in 2.13
220
- Enabled: true
221
- Capybara/SpecificMatcher: # new in 2.12
222
- Enabled: true
223
- RSpec/Rails/HaveHttpStatus: # new in 2.12
224
- Enabled: true
225
-
226
215
  Gemspec/DevelopmentDependencies: # new in 1.44
227
216
  Enabled: true
228
217
  Lint/DuplicateMagicComment: # new in 1.37
@@ -271,22 +260,6 @@ Style/RedundantRegexpConstructor: # new in 1.52
271
260
  Enabled: true
272
261
  Style/RedundantStringEscape: # new in 1.37
273
262
  Enabled: true
274
- Capybara/MatchStyle: # new in 2.17
275
- Enabled: true
276
- Capybara/NegationMatcher: # new in 2.14
277
- Enabled: true
278
- Capybara/SpecificActions: # new in 2.14
279
- Enabled: true
280
- FactoryBot/AssociationStyle: # new in 2.23
281
- Enabled: true
282
- FactoryBot/ConsistentParenthesesStyle: # new in 2.14
283
- Enabled: true
284
- FactoryBot/FactoryAssociationWithStrategy: # new in 2.23
285
- Enabled: true
286
- FactoryBot/FactoryNameStyle: # new in 2.16
287
- Enabled: true
288
- FactoryBot/RedundantFactoryOption: # new in 2.23
289
- Enabled: true
290
263
  RSpec/BeEmpty: # new in 2.20
291
264
  Enabled: true
292
265
  RSpec/ContainExactly: # new in 2.19
@@ -305,9 +278,114 @@ RSpec/SkipBlockInsideExample: # new in 2.19
305
278
  Enabled: true
306
279
  RSpec/SortMetadata: # new in 2.14
307
280
  Enabled: true
308
- RSpec/Rails/InferredSpecType: # new in 2.14
281
+ Gemspec/AddRuntimeDependency: # new in 1.65
282
+ Enabled: true
283
+ Lint/ArrayLiteralInRegexp: # new in 1.71
284
+ Enabled: true
285
+ Lint/ConstantReassignment: # new in 1.70
286
+ Enabled: true
287
+ Lint/CopDirectiveSyntax: # new in 1.72
288
+ Enabled: true
289
+ Lint/DuplicateSetElement: # new in 1.67
290
+ Enabled: true
291
+ Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69
292
+ Enabled: true
293
+ Lint/ItWithoutArgumentsInBlock: # new in 1.59
294
+ Enabled: true
295
+ Lint/LiteralAssignmentInCondition: # new in 1.58
296
+ Enabled: true
297
+ Lint/MixedCaseRange: # new in 1.53
298
+ Enabled: true
299
+ Lint/NumericOperationWithConstantResult: # new in 1.69
300
+ Enabled: true
301
+ Lint/RedundantRegexpQuantifiers: # new in 1.53
302
+ Enabled: true
303
+ Lint/RedundantTypeConversion: # new in 1.72
304
+ Enabled: true
305
+ Lint/SharedMutableDefault: # new in 1.70
306
+ Enabled: true
307
+ Lint/SuppressedExceptionInNumberConversion: # new in 1.72
308
+ Enabled: true
309
+ Lint/UnescapedBracketInRegexp: # new in 1.68
310
+ Enabled: true
311
+ Lint/UselessConstantScoping: # new in 1.72
312
+ Enabled: true
313
+ Lint/UselessDefined: # new in 1.69
314
+ Enabled: true
315
+ Lint/UselessNumericOperation: # new in 1.66
316
+ Enabled: true
317
+ Style/AmbiguousEndlessMethodDefinition: # new in 1.68
318
+ Enabled: true
319
+ Style/BitwisePredicate: # new in 1.68
320
+ Enabled: true
321
+ Style/CombinableDefined: # new in 1.68
322
+ Enabled: true
323
+ Style/DigChain: # new in 1.69
324
+ Enabled: true
325
+ Style/FileNull: # new in 1.69
326
+ Enabled: true
327
+ Style/FileTouch: # new in 1.69
328
+ Enabled: true
329
+ Style/HashSlice: # new in 1.71
330
+ Enabled: true
331
+ Style/ItAssignment: # new in 1.70
332
+ Enabled: true
333
+ Style/KeywordArgumentsMerging: # new in 1.68
334
+ Enabled: true
335
+ Style/MapIntoArray: # new in 1.63
336
+ Enabled: true
337
+ Style/RedundantCurrentDirectoryInPath: # new in 1.53
338
+ Enabled: true
339
+ Style/RedundantFormat: # new in 1.72
340
+ Enabled: true
341
+ Style/RedundantInterpolationUnfreeze: # new in 1.66
342
+ Enabled: true
343
+ Style/RedundantRegexpArgument: # new in 1.53
344
+ Enabled: true
345
+ Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
346
+ Enabled: true
347
+ Style/SafeNavigationChainLength: # new in 1.68
348
+ Enabled: true
349
+ Style/SendWithLiteralMethodName: # new in 1.64
350
+ Enabled: true
351
+ Style/SingleLineDoEndBlock: # new in 1.57
352
+ Enabled: true
353
+ Style/SuperArguments: # new in 1.64
354
+ Enabled: true
355
+ Style/SuperWithArgsParentheses: # new in 1.58
356
+ Enabled: true
357
+ Style/YAMLFileRead: # new in 1.53
358
+ Enabled: true
359
+
360
+ Gemspec/AttributeAssignment: # new in 1.77
361
+ Enabled: true
362
+ Layout/EmptyLinesAfterModuleInclusion: # new in 1.79
363
+ Enabled: true
364
+ Lint/UselessDefaultValueArgument: # new in 1.76
365
+ Enabled: true
366
+ Lint/UselessOr: # new in 1.76
367
+ Enabled: true
368
+ Naming/PredicateMethod: # new in 1.76
369
+ Enabled: true
370
+ Style/ArrayIntersectWithSingleElement: # new in 1.81
371
+ Enabled: true
372
+ Style/CollectionQuerying: # new in 1.77
373
+ Enabled: true
374
+ Style/ComparableBetween: # new in 1.74
375
+ Enabled: true
376
+ Style/EmptyStringInsideInterpolation: # new in 1.76
377
+ Enabled: true
378
+ Style/HashFetchChain: # new in 1.75
379
+ Enabled: true
380
+ Style/ItBlockParameter: # new in 1.75
381
+ Enabled: true
382
+ Style/ModuleMemberExistenceCheck: # new in 1.82
383
+ Enabled: true
384
+ Style/RedundantArrayFlatten: # new in 1.76
309
385
  Enabled: true
310
- RSpec/Rails/MinitestAssertions: # new in 2.17
386
+ RSpec/IncludeExamples: # new in 3.6
311
387
  Enabled: true
312
- RSpec/Rails/TravelAround: # new in 2.19
388
+ RSpec/LeakyLocalVariable: # new in 3.8
313
389
  Enabled: true
390
+ RSpec/Output: # new in 3.9
391
+ Enabled: true
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- preservation-client (7.1.0)
4
+ preservation-client (7.2.0)
5
5
  activesupport (>= 4.2)
6
6
  faraday (~> 2.0)
7
7
  moab-versioning (>= 5.0.0, < 7)
@@ -10,138 +10,135 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (8.0.1)
13
+ activesupport (8.1.2)
14
14
  base64
15
- benchmark (>= 0.3)
16
15
  bigdecimal
17
16
  concurrent-ruby (~> 1.0, >= 1.3.1)
18
17
  connection_pool (>= 2.2.5)
19
18
  drb
20
19
  i18n (>= 1.6, < 2)
20
+ json
21
21
  logger (>= 1.4.2)
22
22
  minitest (>= 5.1)
23
23
  securerandom (>= 0.3)
24
24
  tzinfo (~> 2.0, >= 2.0.5)
25
25
  uri (>= 0.13.1)
26
- addressable (2.8.7)
27
- public_suffix (>= 2.0.2, < 7.0)
28
- ast (2.4.2)
29
- base64 (0.2.0)
30
- benchmark (0.4.0)
31
- bigdecimal (3.1.9)
32
- byebug (11.1.3)
26
+ addressable (2.8.8)
27
+ public_suffix (>= 2.0.2, < 8.0)
28
+ ast (2.4.3)
29
+ base64 (0.3.0)
30
+ bigdecimal (4.0.1)
31
+ byebug (12.0.0)
33
32
  coderay (1.1.3)
34
- concurrent-ruby (1.3.5)
35
- connection_pool (2.5.0)
36
- crack (1.0.0)
33
+ concurrent-ruby (1.3.6)
34
+ connection_pool (3.0.2)
35
+ crack (1.0.1)
37
36
  bigdecimal
38
37
  rexml
39
- diff-lcs (1.5.1)
38
+ diff-lcs (1.6.2)
40
39
  docile (1.4.1)
41
- drb (2.2.1)
40
+ drb (2.2.3)
42
41
  druid-tools (3.0.0)
43
- faraday (2.12.2)
42
+ faraday (2.14.0)
44
43
  faraday-net_http (>= 2.0, < 3.5)
45
44
  json
46
45
  logger
47
- faraday-net_http (3.4.0)
48
- net-http (>= 0.5.0)
49
- hashdiff (1.1.2)
50
- i18n (1.14.7)
46
+ faraday-net_http (3.4.2)
47
+ net-http (~> 0.5)
48
+ hashdiff (1.2.1)
49
+ i18n (1.14.8)
51
50
  concurrent-ruby (~> 1.0)
52
- json (2.9.1)
53
- language_server-protocol (3.17.0.4)
54
- logger (1.6.6)
51
+ json (2.18.0)
52
+ language_server-protocol (3.17.0.5)
53
+ lint_roller (1.1.0)
54
+ logger (1.7.0)
55
55
  method_source (1.1.0)
56
- minitest (5.25.4)
57
- moab-versioning (6.1.0)
56
+ minitest (6.0.1)
57
+ prism (~> 1.5)
58
+ moab-versioning (6.1.2)
58
59
  druid-tools (>= 1.0.0)
59
60
  json
60
61
  nokogiri
61
62
  nokogiri-happymapper
62
- net-http (0.6.0)
63
- uri
64
- nokogiri (1.18.2-arm64-darwin)
63
+ net-http (0.9.1)
64
+ uri (>= 0.11.1)
65
+ nokogiri (1.19.0-arm64-darwin)
65
66
  racc (~> 1.4)
66
- nokogiri (1.18.2-x86_64-darwin)
67
+ nokogiri (1.19.0-x86_64-darwin)
67
68
  racc (~> 1.4)
68
- nokogiri (1.18.2-x86_64-linux-gnu)
69
+ nokogiri (1.19.0-x86_64-linux-gnu)
69
70
  racc (~> 1.4)
70
- nokogiri-happymapper (0.10.0)
71
+ nokogiri-happymapper (0.10.1)
71
72
  nokogiri (~> 1.5)
72
- parallel (1.26.3)
73
- parser (3.3.7.1)
73
+ parallel (1.27.0)
74
+ parser (3.3.10.0)
74
75
  ast (~> 2.4.1)
75
76
  racc
76
- pry (0.14.2)
77
+ prism (1.7.0)
78
+ pry (0.15.2)
77
79
  coderay (~> 1.1)
78
80
  method_source (~> 1.0)
79
- pry-byebug (3.10.1)
80
- byebug (~> 11.0)
81
- pry (>= 0.13, < 0.15)
82
- public_suffix (6.0.1)
81
+ pry-byebug (3.11.0)
82
+ byebug (~> 12.0)
83
+ pry (>= 0.13, < 0.16)
84
+ public_suffix (7.0.2)
83
85
  racc (1.8.1)
84
86
  rainbow (3.1.1)
85
- rake (13.2.1)
86
- regexp_parser (2.10.0)
87
- rexml (3.4.0)
88
- rspec (3.13.0)
87
+ rake (13.3.1)
88
+ regexp_parser (2.11.3)
89
+ rexml (3.4.4)
90
+ rspec (3.13.2)
89
91
  rspec-core (~> 3.13.0)
90
92
  rspec-expectations (~> 3.13.0)
91
93
  rspec-mocks (~> 3.13.0)
92
- rspec-core (3.13.3)
94
+ rspec-core (3.13.6)
93
95
  rspec-support (~> 3.13.0)
94
- rspec-expectations (3.13.3)
96
+ rspec-expectations (3.13.5)
95
97
  diff-lcs (>= 1.2.0, < 2.0)
96
98
  rspec-support (~> 3.13.0)
97
- rspec-mocks (3.13.2)
99
+ rspec-mocks (3.13.7)
98
100
  diff-lcs (>= 1.2.0, < 2.0)
99
101
  rspec-support (~> 3.13.0)
100
- rspec-support (3.13.2)
101
- rubocop (1.71.2)
102
+ rspec-support (3.13.6)
103
+ rubocop (1.82.1)
102
104
  json (~> 2.3)
103
- language_server-protocol (>= 3.17.0)
105
+ language_server-protocol (~> 3.17.0.2)
106
+ lint_roller (~> 1.1.0)
104
107
  parallel (~> 1.10)
105
108
  parser (>= 3.3.0.2)
106
109
  rainbow (>= 2.2.2, < 4.0)
107
110
  regexp_parser (>= 2.9.3, < 3.0)
108
- rubocop-ast (>= 1.38.0, < 2.0)
111
+ rubocop-ast (>= 1.48.0, < 2.0)
109
112
  ruby-progressbar (~> 1.7)
110
113
  unicode-display_width (>= 2.4.0, < 4.0)
111
- rubocop-ast (1.38.0)
112
- parser (>= 3.3.1.0)
113
- rubocop-capybara (2.21.0)
114
- rubocop (~> 1.41)
115
- rubocop-factory_bot (2.26.1)
116
- rubocop (~> 1.61)
117
- rubocop-rake (0.6.0)
118
- rubocop (~> 1.0)
119
- rubocop-rspec (2.31.0)
120
- rubocop (~> 1.40)
121
- rubocop-capybara (~> 2.17)
122
- rubocop-factory_bot (~> 2.22)
123
- rubocop-rspec_rails (~> 2.28)
124
- rubocop-rspec_rails (2.29.1)
125
- rubocop (~> 1.61)
114
+ rubocop-ast (1.49.0)
115
+ parser (>= 3.3.7.2)
116
+ prism (~> 1.7)
117
+ rubocop-rake (0.7.1)
118
+ lint_roller (~> 1.1)
119
+ rubocop (>= 1.72.1)
120
+ rubocop-rspec (3.9.0)
121
+ lint_roller (~> 1.1)
122
+ rubocop (~> 1.81)
126
123
  ruby-progressbar (1.13.0)
127
124
  securerandom (0.4.1)
128
125
  simplecov (0.22.0)
129
126
  docile (~> 1.1)
130
127
  simplecov-html (~> 0.11)
131
128
  simplecov_json_formatter (~> 0.1)
132
- simplecov-html (0.13.1)
129
+ simplecov-html (0.13.2)
133
130
  simplecov_json_formatter (0.1.4)
134
131
  tzinfo (2.0.6)
135
132
  concurrent-ruby (~> 1.0)
136
- unicode-display_width (3.1.4)
137
- unicode-emoji (~> 4.0, >= 4.0.4)
138
- unicode-emoji (4.0.4)
139
- uri (1.0.2)
140
- webmock (3.25.0)
133
+ unicode-display_width (3.2.0)
134
+ unicode-emoji (~> 4.1)
135
+ unicode-emoji (4.2.0)
136
+ uri (1.1.1)
137
+ webmock (3.26.1)
141
138
  addressable (>= 2.8.0)
142
139
  crack (>= 0.3.2)
143
140
  hashdiff (>= 0.4.0, < 2.0.0)
144
- zeitwerk (2.7.1)
141
+ zeitwerk (2.7.4)
145
142
 
146
143
  PLATFORMS
147
144
  arm64-darwin-23
@@ -160,9 +157,9 @@ DEPENDENCIES
160
157
  rspec (~> 3.0)
161
158
  rubocop (~> 1.24)
162
159
  rubocop-rake
163
- rubocop-rspec (~> 2.1)
160
+ rubocop-rspec
164
161
  simplecov
165
162
  webmock
166
163
 
167
164
  BUNDLED WITH
168
- 2.4.13
165
+ 2.7.2
data/README.md CHANGED
@@ -65,9 +65,10 @@ Note that the preservation service is behind a firewall.
65
65
  - druids may be with or without the "druid:" prefix - 'oo000oo0000' or 'druid:oo000oo0000'
66
66
  - methods can be called as `client_instance.objects.method` or `Preservation::Client.objects.method`
67
67
 
68
- ### Get the current version of a preserved object (Moab)
68
+ ### Get information about the preserved object (Moab)
69
69
 
70
70
  - `client.objects.current_version('oo000oo0000')` - returns latest version as an Integer
71
+ - `client.objects.object('oo000oo0000')` - returns Preservation::client::Object
71
72
 
72
73
  ### Retrieve file signature (checksum) information
73
74
 
@@ -38,11 +38,17 @@ module Preservation
38
38
  inventory_diff.group_difference('content')
39
39
  end
40
40
 
41
+ # @param [String] druid - with or without prefix: 'druid:ab123cd4567' OR 'ab123cd4567'
42
+ # @return [Preservation::Client::Object] attributes of the Preserved Object
43
+ def object(druid)
44
+ resp_body = get_json("objects/#{druid}.json", druid)
45
+ Object.new(**resp_body)
46
+ end
47
+
41
48
  # @param [String] druid - with or without prefix: 'druid:ab123cd4567' OR 'ab123cd4567'
42
49
  # @return [Integer] the current version of the Preserved Object
43
50
  def current_version(druid)
44
- resp_body = get_json("objects/#{druid}.json", druid)
45
- resp_body[:current_version]
51
+ object(druid).current_version
46
52
  end
47
53
 
48
54
  # retrieve a content file from a Moab object
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Preservation
4
4
  class Client
5
- VERSION = '7.1.0'
5
+ VERSION = '7.2.0'
6
6
  end
7
7
  end
@@ -34,6 +34,12 @@ module Preservation
34
34
  # timeouts
35
35
  class ConnectionFailedError < Error; end
36
36
 
37
+ Object = Struct.new('Object', :druid, :current_version, :ok_on_local_storage) do
38
+ def ok_on_local_storage?
39
+ ok_on_local_storage
40
+ end
41
+ end
42
+
37
43
  DEFAULT_API_VERSION = 'v1'
38
44
  DEFAULT_TIMEOUT = 300
39
45
  TOKEN_HEADER = 'Authorization'
@@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency 'rspec', '~> 3.0'
41
41
  spec.add_development_dependency 'rubocop', '~> 1.24'
42
42
  spec.add_development_dependency 'rubocop-rake'
43
- spec.add_development_dependency 'rubocop-rspec', '~> 2.1'
43
+ spec.add_development_dependency 'rubocop-rspec'
44
44
  spec.add_development_dependency 'simplecov'
45
45
  spec.add_development_dependency 'webmock'
46
46
  spec.metadata['rubygems_mfa_required'] = 'true'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preservation-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.0
4
+ version: 7.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naomi Dushay
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-02-18 00:00:00.000000000 Z
10
+ date: 2026-01-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport
@@ -159,16 +159,16 @@ dependencies:
159
159
  name: rubocop-rspec
160
160
  requirement: !ruby/object:Gem::Requirement
161
161
  requirements:
162
- - - "~>"
162
+ - - ">="
163
163
  - !ruby/object:Gem::Version
164
- version: '2.1'
164
+ version: '0'
165
165
  type: :development
166
166
  prerelease: false
167
167
  version_requirements: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - "~>"
169
+ - - ">="
170
170
  - !ruby/object:Gem::Version
171
- version: '2.1'
171
+ version: '0'
172
172
  - !ruby/object:Gem::Dependency
173
173
  name: simplecov
174
174
  requirement: !ruby/object:Gem::Requirement
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
247
  - !ruby/object:Gem::Version
248
248
  version: '0'
249
249
  requirements: []
250
- rubygems_version: 3.6.3
250
+ rubygems_version: 3.6.2
251
251
  specification_version: 4
252
252
  summary: A thin client for getting info from SDR preservation.
253
253
  test_files: []