dor-services-client 7.4.0 → 7.7.1

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: b5a1f99d266d396b3a463a2bd357123aa1d68b967c99a959c57fa00f3e3a6e4e
4
- data.tar.gz: b5fa2927a2895ddb1505d2e0caea432089babd0065c28c3ddc580d131ef9bb90
3
+ metadata.gz: 8d879cd3b73b2dba4e04252bc66d32552a2ddbcb8935a4f59136d08a9741fa54
4
+ data.tar.gz: 6b6f48eb757a52ad7aa4f8b60abc8d8798131a31281018373725d14ce57cc0dd
5
5
  SHA512:
6
- metadata.gz: fceeb4329d3b5c2f74d5f469896eb9f60484a9677253d8e47e5591eed1ae724d6014e7811adba986eca83ef76da41945f6b57f4309344f4ba5059c5768d70929
7
- data.tar.gz: 767ec0e6ef1520f3bf2bee9bab789e709c657dce6eeb91f3d376560cfe3b55fa1c36d9635e0ccc9fc97e4d35133bd5a3c679bc97dc5869ae81ad0a938bc26905
6
+ metadata.gz: d050e0e58cd9b00aef611e2ceef7766d6c607536c94c03fbc5bb30123e084e72338ae22e073c2686b31ac3dd9ac7dae55a24557e6c472656575264f1c9ca5045
7
+ data.tar.gz: 2b9aef700ce2328cf8267685d82507cecc4dd5200b11dd4d76107bcb30e97b2ee045f35ba543e4a43d422baec6dd4d44be2b5bb5091447a3b085b1823b5d9055
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: 47b57fbbf65654b17f33b6ff4a108ce2abed31a86468033f20eb4d4e9e09935a
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,10 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
+ require:
4
+ - rubocop-rspec
5
+
3
6
  AllCops:
4
- TargetRubyVersion: 2.6
7
+ TargetRubyVersion: 2.7 # dor-services-app can't be 3 due to fedora3
5
8
  SuggestExtensions: false
6
9
 
7
10
  Metrics/BlockLength:
@@ -81,3 +84,47 @@ Layout/LineEndStringConcatenationIndentation: # (new in 1.18)
81
84
  Enabled: true
82
85
  Naming/InclusiveLanguage: # (new in 1.18)
83
86
  Enabled: true
87
+
88
+ Gemspec/RequireMFA: # new in 1.23
89
+ Enabled: true
90
+ Lint/AmbiguousOperatorPrecedence: # new in 1.21
91
+ Enabled: true
92
+ Lint/AmbiguousRange: # new in 1.19
93
+ Enabled: true
94
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
95
+ Enabled: true
96
+ Lint/RequireRelativeSelfPath: # new in 1.22
97
+ Enabled: true
98
+ Lint/UselessRuby2Keywords: # new in 1.23
99
+ Enabled: true
100
+ Naming/BlockForwarding: # new in 1.24
101
+ Enabled: true
102
+ Security/IoMethods: # new in 1.22
103
+ Enabled: true
104
+ Style/FileRead: # new in 1.24
105
+ Enabled: true
106
+ Style/FileWrite: # new in 1.24
107
+ Enabled: true
108
+ Style/MapToHash: # new in 1.24
109
+ Enabled: true
110
+ Style/NumberedParameters: # new in 1.22
111
+ Enabled: true
112
+ Style/NumberedParametersLimit: # new in 1.22
113
+ Enabled: true
114
+ Style/OpenStructUse: # new in 1.23
115
+ Enabled: true
116
+ Style/RedundantSelfAssignmentBranch: # new in 1.19
117
+ Enabled: true
118
+ Style/SelectByRegexp: # new in 1.22
119
+ Enabled: true
120
+
121
+ RSpec/ExcessiveDocstringSpacing: # new in 2.5
122
+ Enabled: true
123
+ RSpec/IdenticalEqualityAssertion: # new in 2.4
124
+ Enabled: true
125
+ RSpec/SubjectDeclaration: # new in 2.5
126
+ Enabled: true
127
+ RSpec/FactoryBot/SyntaxMethods: # new in 2.7
128
+ Enabled: true
129
+ RSpec/Rails/AvoidSetupHook: # new in 2.4
130
+ Enabled: true
data/.rubocop_todo.yml CHANGED
@@ -1,22 +1,86 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2021-03-17 17:24:07 UTC using RuboCop version 1.11.0.
2
+ # `rubocop --auto-gen-config --auto-gen-only-exclude`
3
+ # on 2022-01-14 01:12: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
9
  # Offense count: 2
10
- # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
10
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max.
11
11
  Metrics/AbcSize:
12
- Max: 22
12
+ Exclude:
13
+ - 'lib/dor/services/client/marcxml.rb'
13
14
 
14
15
  # Offense count: 1
15
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
16
+ # Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
16
17
  Metrics/MethodLength:
17
- Max: 11
18
+ Exclude:
19
+ - 'lib/dor/services/client/transfer.rb'
20
+
21
+ # Offense count: 4
22
+ RSpec/AnyInstance:
23
+ Exclude:
24
+ - 'spec/dor/services/client/async_result_spec.rb'
25
+ - 'spec/dor/services/client/metadata_spec.rb'
26
+ - 'spec/dor/services/client/object_version_spec.rb'
27
+
28
+ # Offense count: 1
29
+ # Configuration parameters: Max, CountAsOne.
30
+ RSpec/ExampleLength:
31
+ Exclude:
32
+ - 'spec/dor/services/client/metadata_spec.rb'
33
+
34
+ # Offense count: 6
35
+ RSpec/IdenticalEqualityAssertion:
36
+ Exclude:
37
+ - 'spec/dor/services/client_spec.rb'
38
+
39
+ # Offense count: 8
40
+ # Configuration parameters: Max.
41
+ RSpec/MultipleExpectations:
42
+ Exclude:
43
+ - 'spec/dor/services/client/async_result_spec.rb'
44
+ - 'spec/dor/services/client/background_job_results_spec.rb'
45
+ - 'spec/dor/services/client/events_spec.rb'
46
+ - 'spec/dor/services/client/object_spec.rb'
47
+ - 'spec/dor/services/client/response_error_formatter_spec.rb'
48
+
49
+ # Offense count: 7
50
+ # Configuration parameters: AllowSubject, Max.
51
+ RSpec/MultipleMemoizedHelpers:
52
+ Exclude:
53
+ - 'spec/dor/services/client/objects_spec.rb'
54
+
55
+ # Offense count: 1
56
+ # Cop supports --auto-correct.
57
+ RSpec/MultipleSubjects:
58
+ Exclude:
59
+ - 'spec/dor/services/client/object_spec.rb'
60
+
61
+ # Offense count: 13
62
+ # Configuration parameters: Max.
63
+ RSpec/NestedGroups:
64
+ Exclude:
65
+ - 'spec/dor/services/client/accession_spec.rb'
66
+ - 'spec/dor/services/client/background_job_results_spec.rb'
67
+ - 'spec/dor/services/client/metadata_spec.rb'
68
+ - 'spec/dor/services/client/objects_spec.rb'
69
+ - 'spec/dor/services/client_spec.rb'
70
+
71
+ # Offense count: 4
72
+ RSpec/RepeatedDescription:
73
+ Exclude:
74
+ - 'spec/dor/services/client/object_spec.rb'
75
+
76
+ # Offense count: 3
77
+ # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
78
+ RSpec/VerifiedDoubles:
79
+ Exclude:
80
+ - 'spec/dor/services/client/response_error_formatter_spec.rb'
18
81
 
19
82
  # Offense count: 1
83
+ # Configuration parameters: AllowedConstants.
20
84
  Style/Documentation:
21
85
  Exclude:
22
86
  - 'spec/**/*'
@@ -25,7 +89,7 @@ Style/Documentation:
25
89
 
26
90
  # Offense count: 77
27
91
  # Cop supports --auto-correct.
28
- # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
92
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
29
93
  # URISchemes: http, https
30
94
  Layout/LineLength:
31
95
  Max: 164
data/README.md CHANGED
@@ -96,6 +96,9 @@ object_client.update(params: dro)
96
96
  # Publish an object (push to PURL)
97
97
  object_client.publish(workflow: 'releaseWF', lane_id: 'low')
98
98
 
99
+ # Unpublish an object (yank from PURL)
100
+ object_client.unpublish()
101
+
99
102
  # Shelve an object (push to Stacks)
100
103
  object_client.shelve(lane_id: 'low')
101
104
 
@@ -22,10 +22,10 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.required_ruby_version = '~> 2.6'
25
+ spec.required_ruby_version = '>= 2.7', '< 4' # dor-services-app needs 2.7 due to fedora3
26
26
 
27
27
  spec.add_dependency 'activesupport', '>= 4.2', '< 8'
28
- spec.add_dependency 'cocina-models', '~> 0.62.0' # leave pinned to patch level until cocina-models hits 1.0
28
+ spec.add_dependency 'cocina-models', '~> 0.63.1' # leave pinned to patch level until cocina-models hits 1.0
29
29
  spec.add_dependency 'deprecation', '>= 0'
30
30
  spec.add_dependency 'faraday', '>= 0.15', '< 2'
31
31
  spec.add_dependency 'zeitwerk', '~> 2.1'
@@ -35,6 +35,8 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency 'rake', '>= 12.3.3'
36
36
  spec.add_development_dependency 'rspec', '~> 3.0'
37
37
  spec.add_development_dependency 'rubocop', '~> 1.0'
38
- spec.add_development_dependency 'simplecov', '~> 0.17.0' # CodeClimate cannot use SimpleCov >= 0.18.0 for generating test coverage
38
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.1'
39
+ spec.add_development_dependency 'simplecov'
39
40
  spec.add_development_dependency 'webmock'
41
+ spec.metadata['rubygems_mfa_required'] = 'true'
40
42
  end
@@ -83,7 +83,7 @@ module Dor
83
83
  Transfer.new(**parent_params)
84
84
  end
85
85
 
86
- delegate :publish, :preserve, :shelve, to: :transfer
86
+ delegate :publish, :unpublish, :preserve, :shelve, to: :transfer
87
87
 
88
88
  def mutate
89
89
  Mutate.new(**parent_params)
@@ -14,9 +14,9 @@ module Dor
14
14
  # Publish an object (send to PURL)
15
15
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
16
16
  # @raise [UnexpectedResponse] when the response is not successful.
17
- # @param [String] workflow ('accessionWF') which workflow to callback to.
17
+ # @param [String] workflow (nil) which workflow to callback to.
18
18
  # @param [String] lane_id for prioritization (default or low)
19
- # @return [boolean] true on success
19
+ # @return [String] the URL of the background job on dor-service-app
20
20
  def publish(workflow: nil, lane_id: nil)
21
21
  query_params = [].tap do |params|
22
22
  params << "workflow=#{workflow}" if workflow
@@ -32,6 +32,19 @@ module Dor
32
32
  raise_exception_based_on_response!(resp)
33
33
  end
34
34
 
35
+ # Unpublish an object (yank from to PURL)
36
+ # @raise [NotFoundResponse] when the response is a 404 (object not found)
37
+ # @raise [UnexpectedResponse] when the response is not successful.
38
+ # @return [String] the URL of the background job on dor-service-app
39
+ def unpublish
40
+ resp = connection.post do |req|
41
+ req.url "#{object_path}/unpublish"
42
+ end
43
+ return resp.headers['Location'] if resp.success?
44
+
45
+ raise_exception_based_on_response!(resp)
46
+ end
47
+
35
48
  # Preserve an object (send to SDR)
36
49
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
37
50
  # @raise [UnexpectedResponse] when the response is not successful.
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '7.4.0'
6
+ VERSION = '7.7.1'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.4.0
4
+ version: 7.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-12-16 00:00:00.000000000 Z
12
+ date: 2022-01-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -37,14 +37,14 @@ dependencies:
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.62.0
40
+ version: 0.63.1
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.62.0
47
+ version: 0.63.1
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: deprecation
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -164,19 +164,33 @@ dependencies:
164
164
  - !ruby/object:Gem::Version
165
165
  version: '1.0'
166
166
  - !ruby/object:Gem::Dependency
167
- name: simplecov
167
+ name: rubocop-rspec
168
168
  requirement: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: 0.17.0
172
+ version: '2.1'
173
173
  type: :development
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: 0.17.0
179
+ version: '2.1'
180
+ - !ruby/object:Gem::Dependency
181
+ name: simplecov
182
+ requirement: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ type: :development
188
+ prerelease: false
189
+ version_requirements: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
180
194
  - !ruby/object:Gem::Dependency
181
195
  name: webmock
182
196
  requirement: !ruby/object:Gem::Requirement
@@ -237,16 +251,20 @@ files:
237
251
  - lib/dor/services/client/workspace.rb
238
252
  homepage: https://github.com/sul-dlss/dor-services-client
239
253
  licenses: []
240
- metadata: {}
254
+ metadata:
255
+ rubygems_mfa_required: 'true'
241
256
  post_install_message:
242
257
  rdoc_options: []
243
258
  require_paths:
244
259
  - lib
245
260
  required_ruby_version: !ruby/object:Gem::Requirement
246
261
  requirements:
247
- - - "~>"
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '2.7'
265
+ - - "<"
248
266
  - !ruby/object:Gem::Version
249
- version: '2.6'
267
+ version: '4'
250
268
  required_rubygems_version: !ruby/object:Gem::Requirement
251
269
  requirements:
252
270
  - - ">="