dor-workflow-service 2.9.0 → 2.10.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 +4 -4
- data/.rubocop_todo.yml +5 -5
- data/lib/dor/services/workflow_service.rb +19 -10
- data/lib/dor/workflow_version.rb +1 -1
- data/spec/workflow_service_spec.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a551f16bb333247b5b41a432f1c9b0fa22767b00fe6d9c2b1268e774c671a0ee
|
4
|
+
data.tar.gz: ed7bb2ceaf955c1474a1ce09db561cd695cd2a5c52f8fe3b207c886a4cdcdfda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9885f3d7e3535bd4b6a074502aac1fe924de902148d53ecaf1375907ddbe013cc3b27fb9a58c3282d94faa8ae70fbb5bdf4099cafe1195909a6900a8c67eba2
|
7
|
+
data.tar.gz: 7ee482c8b021948da5563e3118d4f09b2cbe44cceb99ec9333140d701d6f1f6d313edb5a0714540a8b9b3b3fa9db4ebf4b138f092802629ebe0da38b3c2afa15
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2019-
|
3
|
+
# on 2019-03-12 08:34:30 -0500 using RuboCop version 0.63.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
|
@@ -16,19 +16,19 @@ Lint/UselessAssignment:
|
|
16
16
|
Exclude:
|
17
17
|
- 'lib/dor/services/workflow_service.rb'
|
18
18
|
|
19
|
-
# Offense count:
|
19
|
+
# Offense count: 1
|
20
20
|
Metrics/AbcSize:
|
21
21
|
Max: 22
|
22
22
|
|
23
23
|
# Offense count: 1
|
24
24
|
# Configuration parameters: CountComments.
|
25
25
|
Metrics/ClassLength:
|
26
|
-
Max:
|
26
|
+
Max: 257
|
27
27
|
|
28
|
-
# Offense count:
|
28
|
+
# Offense count: 3
|
29
29
|
# Configuration parameters: CountComments, ExcludedMethods.
|
30
30
|
Metrics/MethodLength:
|
31
|
-
Max:
|
31
|
+
Max: 13
|
32
32
|
|
33
33
|
# Offense count: 2
|
34
34
|
# Configuration parameters: CountKeywordArgs.
|
@@ -499,16 +499,7 @@ module Dor
|
|
499
499
|
end
|
500
500
|
@@http_conn = case url_or_connection
|
501
501
|
when String
|
502
|
-
|
503
|
-
faraday.response :logger if opts[:debug] # logs to STDOUT
|
504
|
-
faraday.use Faraday::Response::RaiseError
|
505
|
-
faraday.adapter :net_http_persistent # use Keep-Alive connections
|
506
|
-
faraday.options.params_encoder = Faraday::FlatParamsEncoder
|
507
|
-
if opts.key? :timeout
|
508
|
-
faraday.options.timeout = opts[:timeout]
|
509
|
-
faraday.options.open_timeout = opts[:timeout]
|
510
|
-
end
|
511
|
-
end
|
502
|
+
build_connection(url_or_connection, opts)
|
512
503
|
else
|
513
504
|
url_or_connection
|
514
505
|
end
|
@@ -521,6 +512,24 @@ module Dor
|
|
521
512
|
|
522
513
|
protected
|
523
514
|
|
515
|
+
def build_connection(url, opts)
|
516
|
+
Faraday.new(url: url) do |faraday|
|
517
|
+
faraday.response :logger if opts[:debug] # logs to STDOUT
|
518
|
+
faraday.use Faraday::Response::RaiseError
|
519
|
+
faraday.adapter :net_http_persistent # use Keep-Alive connections
|
520
|
+
faraday.options.params_encoder = Faraday::FlatParamsEncoder
|
521
|
+
if opts.key? :timeout
|
522
|
+
faraday.options.timeout = opts[:timeout]
|
523
|
+
faraday.options.open_timeout = opts[:timeout]
|
524
|
+
end
|
525
|
+
faraday.headers[:user_agent] = user_agent
|
526
|
+
end
|
527
|
+
end
|
528
|
+
|
529
|
+
def user_agent
|
530
|
+
"dor-workflow-service #{Dor::Workflow::Service::VERSION}"
|
531
|
+
end
|
532
|
+
|
524
533
|
def build_queued_uri(repository, opts = {})
|
525
534
|
uri_string = "workflow_queue/all_queued?repository=#{repository}"
|
526
535
|
uri_string += "&hours-ago=#{opts[:hours_ago]}" if opts[:hours_ago]
|
data/lib/dor/workflow_version.rb
CHANGED
@@ -55,12 +55,17 @@ describe Dor::WorkflowService do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
describe '#configure' do
|
58
|
-
|
59
|
-
|
58
|
+
let(:conn) { Dor::WorkflowService.configure 'http://externalhost/', timeout: 99 }
|
59
|
+
|
60
|
+
it 'has a timeout' do
|
60
61
|
expect(conn).to be_a(Faraday::Connection)
|
61
62
|
expect(conn.options.timeout).to eq(99)
|
62
63
|
expect(conn.options.open_timeout).to eq(99)
|
63
64
|
end
|
65
|
+
|
66
|
+
it 'has a user_agent' do
|
67
|
+
expect(conn.headers).to include('User-Agent' => /dor-workflow-service \d+\.\d+\.\d+/)
|
68
|
+
end
|
64
69
|
end
|
65
70
|
|
66
71
|
describe '#create_workflow' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-workflow-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willy Mene
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|