preservation-client 3.5.0 → 4.0.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: 859dd579bd9f390d624b4017952f76cd4f7ee652e24cd1a3e6a26ad997df921f
4
- data.tar.gz: 210a26faa77c81accc7e694306e6b51f6ed61a6f2e4bf130a01f0e759b835792
3
+ metadata.gz: 7eee0269825cc3a5d9d0829cb77182adbc808bca2fe5d7dab6a7fc835d387e1d
4
+ data.tar.gz: b6bf9a6c5b2999beaece87a2501a31e8c436258f9dc44bd8c5eadf6e8fc9e520
5
5
  SHA512:
6
- metadata.gz: 1a69642114e5eae5c81bbbc5928e521b29fea8680005579ea7538ed9b9cbefc89c7ff6ce948cfcd4652e29d2f648f4643784ea2b0dbfb6dc3766a3f174db4c91
7
- data.tar.gz: 5338f001b55fc8823164b9a11798cda7dc6910178a76b87dbdd529d86bf7e483e5ed1c3565b80d15c70533b645c4d72e6bcdfdf840f11a7ccef0c49694284979
6
+ metadata.gz: '0855b28859c90a6a5f65d648434dc2895f2da1eb69cbebac0b0ebad90a451c71cd1122a3664ea073b64aa96fe945c26a358e8d756569d47b1180f56d79198ded'
7
+ data.tar.gz: b50c7d13f330e7cd5fcd3b651adc7570ced9db6c40c658d8f14f6f3dafc3d5e250f0ddf4088e3888a7e39e28c91406996770b21a718779b08e9e8688a2233ffb
data/.circleci/config.yml CHANGED
@@ -1,35 +1,10 @@
1
1
  version: 2.1
2
-
3
- jobs:
2
+ orbs:
3
+ ruby-rails: sul-dlss/ruby-rails@2.0.0
4
+ workflows:
4
5
  build:
5
- docker:
6
- - image: circleci/ruby:2.7.1
7
- environment:
8
- CC_TEST_REPORTER_ID: 02e8afad8d0b699828dd69b6f45b598e7317b2d9828ea23380c3a97113068a0c
9
- RAILS_ENV: test
10
- steps:
11
- - checkout
12
- - run:
13
- name: Install Bundler
14
- command: gem install bundler
15
- - run:
16
- name: Which bundler?
17
- command: bundle -v
18
- - run:
19
- name: Bundle Install
20
- command: bundle check || bundle install
21
- - run:
22
- name: Lint using rubocop
23
- command: bundle exec rubocop
24
- - run:
25
- name: Setup Code Climate test-reporter
26
- command: |
27
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
28
- chmod +x ./cc-test-reporter
29
- ./cc-test-reporter before-build
30
- - run:
31
- name: rspec
32
- command: bundle exec rspec
33
- - run:
34
- name: upload test coverage report to Code Climate
35
- command: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
6
+ jobs:
7
+ - ruby-rails/lint:
8
+ name: lint
9
+ - ruby-rails/test-gem:
10
+ name: test
data/.rubocop.yml CHANGED
@@ -1,7 +1,11 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
+ require:
4
+ - rubocop-rspec
5
+ - rubocop-rake
6
+
3
7
  AllCops:
4
- TargetRubyVersion: 2.6
8
+ TargetRubyVersion: 3.0
5
9
 
6
10
  Layout/EmptyLinesAroundClassBody:
7
11
  Enabled: false
@@ -11,7 +15,7 @@ Metrics/BlockLength:
11
15
  - 'preservation-client.gemspec'
12
16
  - 'spec/**/*'
13
17
 
14
- Metrics/LineLength:
18
+ Layout/LineLength:
15
19
  Max: 120
16
20
  Exclude:
17
21
  - 'lib/preservation/client/response_error_formatter.rb'
@@ -26,3 +30,117 @@ Style/Documentation:
26
30
 
27
31
  Style/WordArray:
28
32
  Enabled: false
33
+
34
+ Gemspec/DateAssignment: # new in 1.10
35
+ Enabled: true
36
+ Gemspec/RequireMFA: # new in 1.23
37
+ Enabled: true
38
+ Layout/LineEndStringConcatenationIndentation: # new in 1.18
39
+ Enabled: true
40
+ Layout/SpaceBeforeBrackets: # new in 1.7
41
+ Enabled: true
42
+ Lint/AmbiguousAssignment: # new in 1.7
43
+ Enabled: true
44
+ Lint/AmbiguousOperatorPrecedence: # new in 1.21
45
+ Enabled: true
46
+ Lint/AmbiguousRange: # new in 1.19
47
+ Enabled: true
48
+ Lint/DeprecatedConstants: # new in 1.8
49
+ Enabled: true
50
+ Lint/DuplicateBranch: # new in 1.3
51
+ Enabled: true
52
+ Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
53
+ Enabled: true
54
+ Lint/EmptyBlock: # new in 1.1
55
+ Enabled: true
56
+ Lint/EmptyClass: # new in 1.3
57
+ Enabled: true
58
+ Lint/EmptyInPattern: # new in 1.16
59
+ Enabled: true
60
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
61
+ Enabled: true
62
+ Lint/LambdaWithoutLiteralBlock: # new in 1.8
63
+ Enabled: true
64
+ Lint/NoReturnInBeginEndBlocks: # new in 1.2
65
+ Enabled: true
66
+ Lint/NumberedParameterAssignment: # new in 1.9
67
+ Enabled: true
68
+ Lint/OrAssignmentToConstant: # new in 1.9
69
+ Enabled: true
70
+ Lint/RedundantDirGlobSort: # new in 1.8
71
+ Enabled: true
72
+ Lint/RequireRelativeSelfPath: # new in 1.22
73
+ Enabled: true
74
+ Lint/SymbolConversion: # new in 1.9
75
+ Enabled: true
76
+ Lint/ToEnumArguments: # new in 1.1
77
+ Enabled: true
78
+ Lint/TripleQuotes: # new in 1.9
79
+ Enabled: true
80
+ Lint/UnexpectedBlockArity: # new in 1.5
81
+ Enabled: true
82
+ Lint/UnmodifiedReduceAccumulator: # new in 1.1
83
+ Enabled: true
84
+ Lint/UselessRuby2Keywords: # new in 1.23
85
+ Enabled: true
86
+ Naming/BlockForwarding: # new in 1.24
87
+ Enabled: true
88
+ Security/IoMethods: # new in 1.22
89
+ Enabled: true
90
+ Style/ArgumentsForwarding: # new in 1.1
91
+ Enabled: true
92
+ Style/CollectionCompact: # new in 1.2
93
+ Enabled: true
94
+ Style/DocumentDynamicEvalDefinition: # new in 1.1
95
+ Enabled: true
96
+ Style/EndlessMethod: # new in 1.8
97
+ Enabled: true
98
+ Style/FileRead: # new in 1.24
99
+ Enabled: true
100
+ Style/FileWrite: # new in 1.24
101
+ Enabled: true
102
+ Style/HashConversion: # new in 1.10
103
+ Enabled: true
104
+ Style/HashExcept: # new in 1.7
105
+ Enabled: true
106
+ Style/IfWithBooleanLiteralBranches: # new in 1.9
107
+ Enabled: true
108
+ Style/InPatternThen: # new in 1.16
109
+ Enabled: true
110
+ Style/MapToHash: # new in 1.24
111
+ Enabled: true
112
+ Style/MultilineInPatternThen: # new in 1.16
113
+ Enabled: true
114
+ Style/NegatedIfElseCondition: # new in 1.2
115
+ Enabled: true
116
+ Style/NilLambda: # new in 1.3
117
+ Enabled: true
118
+ Style/NumberedParameters: # new in 1.22
119
+ Enabled: true
120
+ Style/NumberedParametersLimit: # new in 1.22
121
+ Enabled: true
122
+ Style/OpenStructUse: # new in 1.23
123
+ Enabled: true
124
+ Style/QuotedSymbols: # new in 1.16
125
+ Enabled: true
126
+ Style/RedundantArgument: # new in 1.4
127
+ Enabled: true
128
+ Style/RedundantSelfAssignmentBranch: # new in 1.19
129
+ Enabled: true
130
+ Style/SelectByRegexp: # new in 1.22
131
+ Enabled: true
132
+ Style/StringChars: # new in 1.12
133
+ Enabled: true
134
+ Style/SwapValues: # new in 1.1
135
+ Enabled: true
136
+
137
+ RSpec/ExcessiveDocstringSpacing: # new in 2.5
138
+ Enabled: true
139
+ RSpec/IdenticalEqualityAssertion: # new in 2.4
140
+ Enabled: true
141
+ RSpec/SubjectDeclaration: # new in 2.5
142
+ Enabled: true
143
+ RSpec/FactoryBot/SyntaxMethods: # new in 2.7
144
+ Enabled: true
145
+ RSpec/Rails/AvoidSetupHook: # new in 2.4
146
+ Enabled: true
data/.rubocop_todo.yml CHANGED
@@ -1,15 +1,92 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2020-01-27 18:06:55 -0800 using RuboCop version 0.77.0.
2
+ # `rubocop --auto-gen-config --auto-gen-only-exclude`
3
+ # on 2022-01-14 04:40:44 UTC using RuboCop version 1.24.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
+ # Offense count: 1
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'preservation-client.gemspec'
15
+
9
16
  # Offense count: 2
17
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max.
10
18
  Metrics/AbcSize:
11
- Max: 34
19
+ Exclude:
20
+ - 'lib/preservation/client/versioned_api_service.rb'
12
21
 
13
22
  # Offense count: 1
23
+ # Configuration parameters: IgnoredMethods, Max.
14
24
  Metrics/CyclomaticComplexity:
15
- Max: 7
25
+ Exclude:
26
+ - 'lib/preservation/client/versioned_api_service.rb'
27
+
28
+ # Offense count: 1
29
+ # Configuration parameters: Prefixes.
30
+ # Prefixes: when, with, without
31
+ RSpec/ContextWording:
32
+ Exclude:
33
+ - 'spec/preservation/client_spec.rb'
34
+
35
+ # Offense count: 2
36
+ # Configuration parameters: Max, CountAsOne.
37
+ RSpec/ExampleLength:
38
+ Exclude:
39
+ - 'spec/preservation/client/objects_spec.rb'
40
+ - 'spec/preservation/client_spec.rb'
41
+
42
+ # Offense count: 1
43
+ RSpec/IdenticalEqualityAssertion:
44
+ Exclude:
45
+ - 'spec/preservation/client_spec.rb'
46
+
47
+ # Offense count: 4
48
+ # Configuration parameters: Max.
49
+ RSpec/MultipleExpectations:
50
+ Exclude:
51
+ - 'spec/preservation/client/objects_spec.rb'
52
+ - 'spec/preservation/client/response_error_formatter_spec.rb'
53
+ - 'spec/preservation/client_spec.rb'
54
+
55
+ # Offense count: 66
56
+ # Configuration parameters: AllowSubject, Max.
57
+ RSpec/MultipleMemoizedHelpers:
58
+ Exclude:
59
+ - 'spec/preservation/client/catalog_spec.rb'
60
+ - 'spec/preservation/client/objects_spec.rb'
61
+ - 'spec/preservation/client/response_error_formatter_spec.rb'
62
+ - 'spec/preservation/client/versioned_api_service_spec.rb'
63
+
64
+ # Offense count: 10
65
+ # Configuration parameters: IgnoreSharedExamples.
66
+ RSpec/NamedSubject:
67
+ Exclude:
68
+ - 'spec/preservation/client/versioned_api_service_spec.rb'
69
+
70
+ # Offense count: 10
71
+ # Configuration parameters: Max.
72
+ RSpec/NestedGroups:
73
+ Exclude:
74
+ - 'spec/preservation/client/catalog_spec.rb'
75
+ - 'spec/preservation/client/versioned_api_service_spec.rb'
76
+
77
+ # Offense count: 4
78
+ # Cop supports --auto-correct.
79
+ RSpec/ScatteredLet:
80
+ Exclude:
81
+ - 'spec/preservation/client/objects_spec.rb'
82
+
83
+ # Offense count: 24
84
+ RSpec/SubjectStub:
85
+ Exclude:
86
+ - 'spec/preservation/client/objects_spec.rb'
87
+
88
+ # Offense count: 4
89
+ # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
90
+ RSpec/VerifiedDoubles:
91
+ Exclude:
92
+ - 'spec/preservation/client/response_error_formatter_spec.rb'
@@ -4,7 +4,7 @@ module Preservation
4
4
  class Client
5
5
  # This wraps any faraday connection errors with preservation-client errors
6
6
  # see https://www.rubydoc.info/gems/faraday/Faraday/ClientError for info on errors
7
- class ErrorFaradayMiddleware < Faraday::Response::Middleware
7
+ class ErrorFaradayMiddleware < Faraday::Middleware
8
8
  def call(env)
9
9
  @app.call(env)
10
10
  rescue Faraday::ConnectionFailed, Faraday::SSLError, Faraday::TimeoutError => e
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Preservation
4
4
  class Client
5
- VERSION = '3.5.0'
5
+ VERSION = '4.0.0'
6
6
  end
7
7
  end
@@ -31,7 +31,7 @@ module Preservation
31
31
  raise NotFoundError, errmsg
32
32
  rescue Faraday::Error => e
33
33
  errmsg = "Preservation::Client.#{caller_locations.first.label} for #{object_id} " \
34
- "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
34
+ "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
35
35
  raise UnexpectedResponseError, errmsg
36
36
  end
37
37
 
@@ -90,11 +90,11 @@ module Preservation
90
90
  raise UnexpectedResponseError, errmsg
91
91
  rescue Faraday::ResourceNotFound => e
92
92
  errmsg = "Preservation::Client.#{caller_locations.first.label} " \
93
- "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
93
+ "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
94
94
  raise NotFoundError, errmsg
95
95
  rescue Faraday::Error => e
96
96
  errmsg = "Preservation::Client.#{caller_locations.first.label} " \
97
- "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
97
+ "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
98
98
  exception_class = e.response[:status] == 423 ? LockedError : UnexpectedResponseError
99
99
  raise exception_class, errmsg
100
100
  end
@@ -63,6 +63,7 @@ module Preservation
63
63
  end
64
64
 
65
65
  attr_writer :url, :connection, :token
66
+
66
67
  delegate :update, to: :catalog
67
68
 
68
69
  private
@@ -27,17 +27,21 @@ Gem::Specification.new do |spec|
27
27
  spec.bindir = 'exe'
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ['lib']
30
+ spec.required_ruby_version = '>= 2.7' # 3.0 except for dor-services-app
30
31
 
31
32
  spec.add_dependency 'activesupport', '>= 4.2', '< 8'
32
- spec.add_dependency 'faraday', '>= 0.15', '< 2.0'
33
- spec.add_dependency 'moab-versioning', '~> 4.3'
33
+ spec.add_dependency 'faraday', '~> 2.0'
34
+ spec.add_dependency 'moab-versioning', '~> 5.0'
34
35
  spec.add_dependency 'zeitwerk', '~> 2.1'
35
36
 
36
37
  spec.add_development_dependency 'bundler', '~> 2.0'
37
38
  spec.add_development_dependency 'pry-byebug'
38
39
  spec.add_development_dependency 'rake', '>= 12.3.3'
39
40
  spec.add_development_dependency 'rspec', '~> 3.0'
40
- spec.add_development_dependency 'rubocop', '~> 0.77.0'
41
- spec.add_development_dependency 'simplecov', '~> 0.17.0' # For CodeClimate
41
+ spec.add_development_dependency 'rubocop', '~> 1.24'
42
+ spec.add_development_dependency 'rubocop-rake'
43
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.1'
44
+ spec.add_development_dependency 'simplecov'
42
45
  spec.add_development_dependency 'webmock'
46
+ spec.metadata['rubygems_mfa_required'] = 'true'
43
47
  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: 3.5.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naomi Dushay
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-05 00:00:00.000000000 Z
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -34,20 +34,14 @@ dependencies:
34
34
  name: faraday
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: '0.15'
40
- - - "<"
37
+ - - "~>"
41
38
  - !ruby/object:Gem::Version
42
39
  version: '2.0'
43
40
  type: :runtime
44
41
  prerelease: false
45
42
  version_requirements: !ruby/object:Gem::Requirement
46
43
  requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: '0.15'
50
- - - "<"
44
+ - - "~>"
51
45
  - !ruby/object:Gem::Version
52
46
  version: '2.0'
53
47
  - !ruby/object:Gem::Dependency
@@ -56,14 +50,14 @@ dependencies:
56
50
  requirements:
57
51
  - - "~>"
58
52
  - !ruby/object:Gem::Version
59
- version: '4.3'
53
+ version: '5.0'
60
54
  type: :runtime
61
55
  prerelease: false
62
56
  version_requirements: !ruby/object:Gem::Requirement
63
57
  requirements:
64
58
  - - "~>"
65
59
  - !ruby/object:Gem::Version
66
- version: '4.3'
60
+ version: '5.0'
67
61
  - !ruby/object:Gem::Dependency
68
62
  name: zeitwerk
69
63
  requirement: !ruby/object:Gem::Requirement
@@ -140,28 +134,56 @@ dependencies:
140
134
  requirements:
141
135
  - - "~>"
142
136
  - !ruby/object:Gem::Version
143
- version: 0.77.0
137
+ version: '1.24'
144
138
  type: :development
145
139
  prerelease: false
146
140
  version_requirements: !ruby/object:Gem::Requirement
147
141
  requirements:
148
142
  - - "~>"
149
143
  - !ruby/object:Gem::Version
150
- version: 0.77.0
144
+ version: '1.24'
151
145
  - !ruby/object:Gem::Dependency
152
- name: simplecov
146
+ name: rubocop-rake
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ - !ruby/object:Gem::Dependency
160
+ name: rubocop-rspec
153
161
  requirement: !ruby/object:Gem::Requirement
154
162
  requirements:
155
163
  - - "~>"
156
164
  - !ruby/object:Gem::Version
157
- version: 0.17.0
165
+ version: '2.1'
158
166
  type: :development
159
167
  prerelease: false
160
168
  version_requirements: !ruby/object:Gem::Requirement
161
169
  requirements:
162
170
  - - "~>"
163
171
  - !ruby/object:Gem::Version
164
- version: 0.17.0
172
+ version: '2.1'
173
+ - !ruby/object:Gem::Dependency
174
+ name: simplecov
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
165
187
  - !ruby/object:Gem::Dependency
166
188
  name: webmock
167
189
  requirement: !ruby/object:Gem::Requirement
@@ -210,7 +232,8 @@ metadata:
210
232
  allowed_push_host: https://rubygems.org/
211
233
  homepage_uri: https://github.com/sul-dlss/preservation-client
212
234
  source_code_uri: https://github.com/sul-dlss/preservation-client.
213
- post_install_message:
235
+ rubygems_mfa_required: 'true'
236
+ post_install_message:
214
237
  rdoc_options: []
215
238
  require_paths:
216
239
  - lib
@@ -218,15 +241,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
218
241
  requirements:
219
242
  - - ">="
220
243
  - !ruby/object:Gem::Version
221
- version: '0'
244
+ version: '2.7'
222
245
  required_rubygems_version: !ruby/object:Gem::Requirement
223
246
  requirements:
224
247
  - - ">="
225
248
  - !ruby/object:Gem::Version
226
249
  version: '0'
227
250
  requirements: []
228
- rubygems_version: 3.1.4
229
- signing_key:
251
+ rubygems_version: 3.2.32
252
+ signing_key:
230
253
  specification_version: 4
231
254
  summary: A thin client for getting info from SDR preservation.
232
255
  test_files: []