libis-workflow 2.0.19 → 2.0.21

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e665a465a9cff03e17f953974de23cd3ab91131
4
- data.tar.gz: 181f401350092ad4e21a3f20fc2f6678e2efa0d4
3
+ metadata.gz: 1369d1c69a4f8ee9f1d767c2047caf4c5fad0cee
4
+ data.tar.gz: 1b85e8cc488fb1b361ad4d68ff412079f2dacd97
5
5
  SHA512:
6
- metadata.gz: db815e368e494d393b17f6ee382756805c06d2ddbec268913ae2e46b48b666f2966035d58035165082d4693aec755b5e9a3251eee8bc6c935a1cec7abc095786
7
- data.tar.gz: 23161851ae6fe1218d9e12c9c23cf95cbe2af596e9f57fcecb611af40739f3190a4e694c0abf839711c589171cb7438c298ab7decedc4b049e95d4800c89ebb5
6
+ metadata.gz: 9b0bb414ceabdc6a1e1eeaba572ca6b77b4a1772f51bdb174a8cd28bd21f91d8bf09e0d70c230b57e0e3bc47c8ca9d51ae6f7db80c7c6cee5ed4e7f613539adc
7
+ data.tar.gz: 88bd9d8b6b8b5931c7ec35c9a57e0a93bbab802a07a66f299142ae46c08e517c4cefebac7514caf3b74c2421e2ff6419d366c0d0913294f18ca55fd3b81f08ed
@@ -88,10 +88,10 @@ module Libis
88
88
  # @param [String] task namepath of the task
89
89
  # @param [Integer] progress progress indicator (as <progress> of <max> or as % if <max> not set). Default: 0
90
90
  # @param [Integer] max max count.
91
- def status_progress(task, progress = 0, max = nil)
91
+ def status_progress(task, progress, max = nil)
92
92
  log_entry = self.status_entry(task)
93
93
  log_entry ||= self.add_status_log('task' => task, 'status' => :STARTED, 'created' => DateTime.now)
94
- log_entry['progress'] = progress
94
+ log_entry['progress'] = progress ? progress : (log_entry['progress'] || 0) + 1
95
95
  log_entry['max'] = max if max
96
96
  log_entry['updated'] = DateTime.now
97
97
  self.save!
@@ -15,7 +15,7 @@ module Libis
15
15
  include ::Libis::Tools::Logger
16
16
  include ::Libis::Tools::ParameterContainer
17
17
 
18
- attr_accessor :parent, :name, :workitem
18
+ attr_accessor :parent, :name, :workitem, :processing_item
19
19
 
20
20
  parameter recursive: false, description: 'Run the task on all subitems recursively.'
21
21
  parameter abort_recursion_on_failure: false, description: 'Stop processing items recursively if one item fails.'
@@ -157,7 +157,9 @@ module Libis
157
157
 
158
158
  unless @item_skipper
159
159
  set_status item, :STARTED
160
+ self.processing_item = item
160
161
  self.process item
162
+ item = self.processing_item
161
163
  run_subitems(item) if parameter(:recursive)
162
164
  set_status item, :DONE if item.check_status(:STARTED, self.namepath)
163
165
  else
@@ -1,5 +1,5 @@
1
1
  module Libis
2
2
  module Workflow
3
- VERSION = '2.0.19' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
3
+ VERSION = '2.0.21' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libis-workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.19
4
+ version: 2.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Dekeyser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2016-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  requirements: []
193
193
  rubyforge_project:
194
- rubygems_version: 2.4.8
194
+ rubygems_version: 2.6.4
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: LIBIS Workflow framework.