lyber-core 6.1.0 → 6.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lyber_core/robot.rb +10 -6
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1782e67d9093e1626e046f38c5952020d16664350d950ec01cda9790d4dfef4d
4
- data.tar.gz: 8b57bb3810932c6f5ccc5d796f8ee397e0d8e6aab5a72211f29261816f65e72f
3
+ metadata.gz: 72f25a04a8a79879923e52f8a0ba9e8fbb7d7a92deaf195961548cab5898baf2
4
+ data.tar.gz: 9dd75e18b11858d897a1dcdeabb0841595bc1a5db02fed17fe84bdf78c7a249d
5
5
  SHA512:
6
- metadata.gz: dc9eb98caf13bec01711b2326dbc3d2635054669fb1c8e13577b0953939231a2c1b567b4183e73432a11fcb587335b5abef29b64a8f2b94f8f2275c9682d4ad6
7
- data.tar.gz: 7d06278ab9fbcb5d41a48abd9c3691fb3cbf6215b484c601aa39fbf451456e1cebe469cd1df487d3608b7b81cdf882fcb080507ebd0ac583e55762b06a7b4302
6
+ metadata.gz: 479c21c2be8a01e3545035009cfda6c2655e5d78f8e191a5e901be7e33eec7ff2f5b3a0623afce4d73edab1b31f79da0c43f3e0afa379dd40914079ee248476f
7
+ data.tar.gz: edeed4efdf04ee301091f104c1e40047a9f124cfe269be8de88103a0b8ec27632298d9f9a06a1c379b98c0d019131f785721777be41fba924cf92280d6d60b4a
@@ -12,9 +12,9 @@ module LyberCore
12
12
  module ClassMethods
13
13
  # Called by job-manager on derived-class
14
14
  # Instantiate the Robot and call #work with the passed in druid
15
- def perform(druid)
15
+ def perform(druid, *context)
16
16
  bot = new
17
- bot.work druid
17
+ bot.work druid, context
18
18
  end
19
19
  end
20
20
 
@@ -37,11 +37,11 @@ module LyberCore
37
37
  # rubocop:disable Metrics/AbcSize
38
38
  # rubocop:disable Metrics/CyclomaticComplexity
39
39
  # rubocop:disable Metrics/PerceivedComplexity
40
- def work(druid)
40
+ def work(druid, context)
41
41
  Honeybadger.context(druid: druid, process: process, workflow_name: workflow_name) if defined? Honeybadger
42
42
  workflow = workflow(druid)
43
- LyberCore::Log.set_logfile($stdout) # let process manager(bluepill) handle logging
44
- LyberCore::Log.info "#{druid} processing #{process} (#workflow_name)"
43
+ LyberCore::Log.set_logfile($stdout) # let process manager handle logging
44
+ LyberCore::Log.info "#{druid} processing #{process} (#{workflow_name})"
45
45
  return if check_queued_status && !item_queued?(druid)
46
46
 
47
47
  # this is the default note to pass back to workflow service,
@@ -54,7 +54,11 @@ module LyberCore
54
54
 
55
55
  result = nil
56
56
  elapsed = Benchmark.realtime do
57
- result = perform druid # implemented in the mixed-in robot class
57
+ result = if method(:perform).arity == 1
58
+ perform druid # implemented in the mixed-in robot class
59
+ else
60
+ perform druid, context
61
+ end
58
62
  end
59
63
 
60
64
  # the final workflow state is determined by the return value of the perform step, if it is a ReturnState object,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lyber-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 6.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alpana Pande
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2020-02-19 00:00:00.000000000 Z
19
+ date: 2020-03-29 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: coveralls
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  - !ruby/object:Gem::Version
154
154
  version: 1.3.6
155
155
  requirements: []
156
- rubygems_version: 3.0.3
156
+ rubygems_version: 3.1.2
157
157
  signing_key:
158
158
  specification_version: 4
159
159
  summary: Core services used by the SUL Digital Library