preservation-client 6.1.0 → 6.2.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: 1788f528479f4730cfe4fbf27ba42045edcd8cf6accb69dfec2fe53d43b9fc9b
4
- data.tar.gz: b37d9db65f4b7239692f49a8ce64397450c4567c15019218df8fb5bace198ccc
3
+ metadata.gz: 78b7341bd3cc3fb3936f1d452aea6b335e952d514b919d3667cfdf04d1235314
4
+ data.tar.gz: 459a69c3deef3fce9763fdd7d3796b7e883157cc03351a229670e0006d154410
5
5
  SHA512:
6
- metadata.gz: 3f2abb7844a26ecf8ab8901db3e613d26bf576c80b78f053ad3e3a3433e3c716f2795a090953087a1aad06ff454c992df394414971d119daa9d2716e905e6538
7
- data.tar.gz: 0bbb46c34445482b3cadea06f6495454e9739b96e589933361a0aac900c23e40c11b96f65f3d740dc6881dde8b8ee3198f4508087b8d074dbfac8671b0084b37
6
+ metadata.gz: 6f62d97cd2adb3a00a47fb71e57a53bc2e0bd1f392a01f44df3f559ae3d5c1a60e9d7a5e44f8dda1ab4e51637187a3fcd8b8d37e17eeab7a24aa31a06c6a7c03
7
+ data.tar.gz: 947958138878897d08b49a487a72f3952d07200c8fb472dbbd1988346173c5b1747e5ad1f97b98b85ad8990e8f4eb15bd78bc29ad801da017be2118b22dd35cf
data/.circleci/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby-rails: sul-dlss/ruby-rails@3.2.0
3
+ ruby-rails: sul-dlss/ruby-rails@4.1.0
4
4
  workflows:
5
5
  build:
6
6
  jobs:
data/.rubocop.yml CHANGED
@@ -167,7 +167,7 @@ RSpec/IdenticalEqualityAssertion: # new in 2.4
167
167
  Enabled: true
168
168
  RSpec/SubjectDeclaration: # new in 2.5
169
169
  Enabled: true
170
- RSpec/FactoryBot/SyntaxMethods: # new in 2.7
170
+ FactoryBot/SyntaxMethods: # new in 2.7
171
171
  Enabled: true
172
172
  RSpec/Rails/AvoidSetupHook: # new in 2.4
173
173
  Enabled: true
@@ -216,9 +216,98 @@ RSpec/ClassCheck: # new in 2.13
216
216
  Enabled: true
217
217
  RSpec/NoExpectationExample: # new in 2.13
218
218
  Enabled: true
219
- RSpec/Capybara/SpecificFinders: # new in 2.13
219
+ Capybara/SpecificFinders: # new in 2.13
220
220
  Enabled: true
221
- RSpec/Capybara/SpecificMatcher: # new in 2.12
221
+ Capybara/SpecificMatcher: # new in 2.12
222
222
  Enabled: true
223
223
  RSpec/Rails/HaveHttpStatus: # new in 2.12
224
224
  Enabled: true
225
+
226
+ Gemspec/DevelopmentDependencies: # new in 1.44
227
+ Enabled: true
228
+ Lint/DuplicateMagicComment: # new in 1.37
229
+ Enabled: true
230
+ Lint/DuplicateMatchPattern: # new in 1.50
231
+ Enabled: true
232
+ Lint/UselessRescue: # new in 1.43
233
+ Enabled: true
234
+ Metrics/CollectionLiteralLength: # new in 1.47
235
+ Enabled: true
236
+ Style/ArrayIntersect: # new in 1.40
237
+ Enabled: true
238
+ Style/ComparableClamp: # new in 1.44
239
+ Enabled: true
240
+ Style/ConcatArrayLiterals: # new in 1.41
241
+ Enabled: true
242
+ Style/DataInheritance: # new in 1.49
243
+ Enabled: true
244
+ Style/DirEmpty: # new in 1.48
245
+ Enabled: true
246
+ Style/ExactRegexpMatch: # new in 1.51
247
+ Enabled: true
248
+ Style/FileEmpty: # new in 1.48
249
+ Enabled: true
250
+ Style/MapToSet: # new in 1.42
251
+ Enabled: true
252
+ Style/MinMaxComparison: # new in 1.42
253
+ Enabled: true
254
+ Style/OperatorMethodCall: # new in 1.37
255
+ Enabled: true
256
+ Style/RedundantArrayConstructor: # new in 1.52
257
+ Enabled: true
258
+ Style/RedundantConstantBase: # new in 1.40
259
+ Enabled: true
260
+ Style/RedundantDoubleSplatHashBraces: # new in 1.41
261
+ Enabled: true
262
+ Style/RedundantEach: # new in 1.38
263
+ Enabled: true
264
+ Style/RedundantFilterChain: # new in 1.52
265
+ Enabled: true
266
+ Style/RedundantHeredocDelimiterQuotes: # new in 1.45
267
+ Enabled: true
268
+ Style/RedundantLineContinuation: # new in 1.49
269
+ Enabled: true
270
+ Style/RedundantRegexpConstructor: # new in 1.52
271
+ Enabled: true
272
+ Style/RedundantStringEscape: # new in 1.37
273
+ 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
+ RSpec/BeEmpty: # new in 2.20
291
+ Enabled: true
292
+ RSpec/ContainExactly: # new in 2.19
293
+ Enabled: true
294
+ RSpec/DuplicatedMetadata: # new in 2.16
295
+ Enabled: true
296
+ RSpec/IndexedLet: # new in 2.20
297
+ Enabled: true
298
+ RSpec/MatchArray: # new in 2.19
299
+ Enabled: true
300
+ RSpec/PendingWithoutReason: # new in 2.16
301
+ Enabled: true
302
+ RSpec/RedundantAround: # new in 2.19
303
+ Enabled: true
304
+ RSpec/SkipBlockInsideExample: # new in 2.19
305
+ Enabled: true
306
+ RSpec/SortMetadata: # new in 2.14
307
+ Enabled: true
308
+ RSpec/Rails/InferredSpecType: # new in 2.14
309
+ Enabled: true
310
+ RSpec/Rails/MinitestAssertions: # new in 2.17
311
+ Enabled: true
312
+ RSpec/Rails/TravelAround: # new in 2.19
313
+ Enabled: true
data/.rubocop_todo.yml CHANGED
@@ -1,19 +1,13 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config --auto-gen-only-exclude`
3
- # on 2022-10-04 18:22:01 UTC using RuboCop version 1.36.0.
3
+ # on 2023-06-20 05:20:15 UTC using RuboCop version 1.52.1.
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
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
9
  # Offense count: 2
10
- # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes, Max.
10
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
11
11
  Metrics/AbcSize:
12
12
  Exclude:
13
13
  - 'lib/preservation/client/versioned_api_service.rb'
14
-
15
- # Offense count: 1
16
- # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, Max.
17
- Metrics/CyclomaticComplexity:
18
- Exclude:
19
- - 'lib/preservation/client/versioned_api_service.rb'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- preservation-client (6.1.0)
4
+ preservation-client (6.2.0)
5
5
  activesupport (>= 4.2, < 8)
6
6
  faraday (~> 2.0)
7
7
  moab-versioning (>= 5.0.0, < 7)
@@ -10,91 +10,99 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (7.0.4.2)
13
+ activesupport (7.0.7.2)
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.1)
18
+ addressable (2.8.5)
19
19
  public_suffix (>= 2.0.2, < 6.0)
20
20
  ast (2.4.2)
21
+ base64 (0.1.1)
21
22
  byebug (11.1.3)
22
23
  coderay (1.1.3)
23
- concurrent-ruby (1.2.0)
24
+ concurrent-ruby (1.2.2)
24
25
  crack (0.4.5)
25
26
  rexml
26
27
  diff-lcs (1.5.0)
27
28
  docile (1.4.0)
28
29
  druid-tools (3.0.0)
29
- faraday (2.7.4)
30
+ faraday (2.7.10)
30
31
  faraday-net_http (>= 2.0, < 3.1)
31
32
  ruby2_keywords (>= 0.0.4)
32
33
  faraday-net_http (3.0.2)
33
34
  hashdiff (1.0.1)
34
- i18n (1.12.0)
35
+ i18n (1.14.1)
35
36
  concurrent-ruby (~> 1.0)
36
37
  json (2.6.3)
38
+ language_server-protocol (3.17.0.3)
37
39
  method_source (1.0.0)
38
- minitest (5.17.0)
40
+ minitest (5.19.0)
39
41
  moab-versioning (6.1.0)
40
42
  druid-tools (>= 1.0.0)
41
43
  json
42
44
  nokogiri
43
45
  nokogiri-happymapper
44
- nokogiri (1.14.1-x86_64-darwin)
46
+ nokogiri (1.15.4-x86_64-darwin)
45
47
  racc (~> 1.4)
46
- nokogiri (1.14.1-x86_64-linux)
48
+ nokogiri (1.15.4-x86_64-linux)
47
49
  racc (~> 1.4)
48
50
  nokogiri-happymapper (0.9.0)
49
51
  nokogiri (~> 1.5)
50
- parallel (1.22.1)
51
- parser (3.2.0.0)
52
+ parallel (1.23.0)
53
+ parser (3.2.2.3)
52
54
  ast (~> 2.4.1)
55
+ racc
53
56
  pry (0.14.2)
54
57
  coderay (~> 1.1)
55
58
  method_source (~> 1.0)
56
59
  pry-byebug (3.10.1)
57
60
  byebug (~> 11.0)
58
61
  pry (>= 0.13, < 0.15)
59
- public_suffix (5.0.1)
60
- racc (1.6.2)
62
+ public_suffix (5.0.3)
63
+ racc (1.7.1)
61
64
  rainbow (3.1.1)
62
65
  rake (13.0.6)
63
- regexp_parser (2.6.2)
64
- rexml (3.2.5)
66
+ regexp_parser (2.8.1)
67
+ rexml (3.2.6)
65
68
  rspec (3.12.0)
66
69
  rspec-core (~> 3.12.0)
67
70
  rspec-expectations (~> 3.12.0)
68
71
  rspec-mocks (~> 3.12.0)
69
- rspec-core (3.12.1)
72
+ rspec-core (3.12.2)
70
73
  rspec-support (~> 3.12.0)
71
- rspec-expectations (3.12.2)
74
+ rspec-expectations (3.12.3)
72
75
  diff-lcs (>= 1.2.0, < 2.0)
73
76
  rspec-support (~> 3.12.0)
74
- rspec-mocks (3.12.3)
77
+ rspec-mocks (3.12.6)
75
78
  diff-lcs (>= 1.2.0, < 2.0)
76
79
  rspec-support (~> 3.12.0)
77
- rspec-support (3.12.0)
78
- rubocop (1.44.1)
80
+ rspec-support (3.12.1)
81
+ rubocop (1.56.1)
82
+ base64 (~> 0.1.1)
79
83
  json (~> 2.3)
84
+ language_server-protocol (>= 3.17.0)
80
85
  parallel (~> 1.10)
81
- parser (>= 3.2.0.0)
86
+ parser (>= 3.2.2.3)
82
87
  rainbow (>= 2.2.2, < 4.0)
83
88
  regexp_parser (>= 1.8, < 3.0)
84
89
  rexml (>= 3.2.5, < 4.0)
85
- rubocop-ast (>= 1.24.1, < 2.0)
90
+ rubocop-ast (>= 1.28.1, < 2.0)
86
91
  ruby-progressbar (~> 1.7)
87
92
  unicode-display_width (>= 2.4.0, < 3.0)
88
- rubocop-ast (1.24.1)
89
- parser (>= 3.1.1.0)
90
- rubocop-capybara (2.17.0)
93
+ rubocop-ast (1.29.0)
94
+ parser (>= 3.2.1.0)
95
+ rubocop-capybara (2.18.0)
91
96
  rubocop (~> 1.41)
97
+ rubocop-factory_bot (2.23.1)
98
+ rubocop (~> 1.33)
92
99
  rubocop-rake (0.6.0)
93
100
  rubocop (~> 1.0)
94
- rubocop-rspec (2.18.1)
101
+ rubocop-rspec (2.23.2)
95
102
  rubocop (~> 1.33)
96
103
  rubocop-capybara (~> 2.17)
97
- ruby-progressbar (1.11.0)
104
+ rubocop-factory_bot (~> 2.22)
105
+ ruby-progressbar (1.13.0)
98
106
  ruby2_keywords (0.0.5)
99
107
  simplecov (0.22.0)
100
108
  docile (~> 1.1)
@@ -105,15 +113,17 @@ GEM
105
113
  tzinfo (2.0.6)
106
114
  concurrent-ruby (~> 1.0)
107
115
  unicode-display_width (2.4.2)
108
- webmock (3.18.1)
116
+ webmock (3.19.0)
109
117
  addressable (>= 2.8.0)
110
118
  crack (>= 0.3.2)
111
119
  hashdiff (>= 0.4.0, < 2.0.0)
112
- zeitwerk (2.6.6)
120
+ zeitwerk (2.6.11)
113
121
 
114
122
  PLATFORMS
115
123
  x86_64-darwin-19
116
124
  x86_64-darwin-20
125
+ x86_64-darwin-21
126
+ x86_64-darwin-22
117
127
  x86_64-linux
118
128
 
119
129
  DEPENDENCIES
@@ -129,4 +139,4 @@ DEPENDENCIES
129
139
  webmock
130
140
 
131
141
  BUNDLED WITH
132
- 2.4.6
142
+ 2.4.13
data/README.md CHANGED
@@ -31,7 +31,7 @@ Preservation::Client is a singleton object, and thus can be used as a class or a
31
31
  require 'preservation/client'
32
32
 
33
33
  def do_the_thing
34
- current_version_as_integer = client.current_version('druid:oo000oo0000')
34
+ current_version_as_integer = client.objects.current_version('druid:oo000oo0000')
35
35
  end
36
36
 
37
37
  private
@@ -51,7 +51,7 @@ def initialize
51
51
  end
52
52
 
53
53
  def do_the_thing
54
- current_version_as_integer = Preservation::Client.current_version('druid:oo000oo0000')
54
+ current_version_as_integer = Preservation::Client.objects.current_version('druid:oo000oo0000')
55
55
  end
56
56
  ```
57
57
 
@@ -74,6 +74,7 @@ Note that the preservation service is behind a firewall.
74
74
 
75
75
  - `client.objects.checksums(druids: druids)` - returns info as raw csv
76
76
  - `client.objects.checksums(druids: druids, format: 'json')` - returns info as json
77
+ - `client.objects.checksum(druid: 'oo000oo0000')` - returns info as array of hashes
77
78
 
78
79
  ### Retrieve individual files from preservation
79
80
 
@@ -15,6 +15,12 @@ module Preservation
15
15
  post('objects/checksums', druids: druids, format: resp_format)
16
16
  end
17
17
 
18
+ # @param [String] druid - with or without prefix: 'druid:bb123cd4567' OR 'bb123cd4567'
19
+ # @return [Hash] the checksums and filesize for the druid
20
+ def checksum(druid:)
21
+ get_json("objects/#{druid}/checksum", druid)
22
+ end
23
+
18
24
  # @param [String] druid - with or without prefix: 'druid:bb123cd4567' OR 'bb123cd4567'
19
25
  # @param [String] content_metadata - contentMetadata.xml to be compared against a version of Moab
20
26
  # @param [String] subset - (default: 'all') which subset of files to compare (all|shelve|preserve|publish)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Preservation
4
4
  class Client
5
- VERSION = '6.1.0'
5
+ VERSION = '6.2.0'
6
6
  end
7
7
  end
@@ -21,7 +21,7 @@ module Preservation
21
21
  req.headers['Content-Type'] = 'application/json'
22
22
  req.headers['Accept'] = 'application/json'
23
23
  end
24
- return JSON.parse(resp.body).with_indifferent_access if resp.success?
24
+ return with_indifferent_access_for(JSON.parse(resp.body)) if resp.success?
25
25
 
26
26
  errmsg = ResponseErrorFormatter
27
27
  .format(response: resp, object_id: object_id, client_method_name: caller_locations.first.label)
@@ -109,6 +109,16 @@ module Preservation
109
109
  UnexpectedResponseError
110
110
  end
111
111
  end
112
+
113
+ def with_indifferent_access_for(obj)
114
+ if obj.is_a?(Array)
115
+ obj.map { |member| with_indifferent_access_for(member) }
116
+ elsif obj.is_a?(Hash)
117
+ obj.with_indifferent_access
118
+ else
119
+ obj
120
+ end
121
+ end
112
122
  end
113
123
  end
114
124
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preservation-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naomi Dushay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-09 00:00:00.000000000 Z
11
+ date: 2023-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -255,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  - !ruby/object:Gem::Version
256
256
  version: '0'
257
257
  requirements: []
258
- rubygems_version: 3.2.32
258
+ rubygems_version: 3.3.7
259
259
  signing_key:
260
260
  specification_version: 4
261
261
  summary: A thin client for getting info from SDR preservation.