libis-workflow-mongoid 2.0.22 → 2.0.23

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: 3f4c9897a2b6840c784f91fa879b0577fc2ed28f
4
- data.tar.gz: 8ef39b6957b2d1dd29807f3505e0851f276b2f7c
3
+ metadata.gz: 08b193e063d710321a723fae1561fdb9f7bb4bdb
4
+ data.tar.gz: 414358f454bc0094a6e1132399cec90eb5be455a
5
5
  SHA512:
6
- metadata.gz: 62bc606517682d6f2e36737b01fd148882f9a7d942f4ebc5923c8ecef342df367e241b6b91b174475b44c9e635f50c2862e3272ada374913779fa505b329e4ff
7
- data.tar.gz: fb3d056aae30b771af13056688dd75a1e04066d25cc67d7163319cc4d9982d564ca8dd82241cf6e3dcac6bfd0c79f891ca98bc932fc8138d227481cf5f4110cd
6
+ metadata.gz: 0058c98a7a750805a93bb7a267b181e82f0af8a1aa9b40dc342a80e7b46e81ebb84e69c93d6e00029ac4d354be7ca6adbd28261b5488729e2081d59f420b2ea3
7
+ data.tar.gz: 80fda526c90b79eaaa8c01fbcf7d43d0312b8688218a811a0e69b56afb3e3d7efe88269f5700d42ff97c141d604ff3f2e16d48b7a710e059aa1dbcd39c145d47
@@ -58,11 +58,13 @@ module Libis
58
58
 
59
59
  # noinspection RubyStringKeysInHashInspection
60
60
  def execute(opts = {})
61
+ opts['run_config'] ||= {}
61
62
  if self.log_each_run
62
- opts['run_config'] = {
63
- 'log_to_file' => true,
64
- 'log_level' => self.log_level
65
- }
63
+ opts['run_config']['log_to_file'] = true
64
+ opts['run_config']['log_level'] = self.log_level
65
+ end
66
+ if (run_name = opts.delete('run_name'))
67
+ opts['run_config']['run_name'] = run_name
66
68
  end
67
69
  super opts
68
70
  end
@@ -14,6 +14,7 @@ module Libis
14
14
  field :log_to_file, type: Boolean, default: false
15
15
  field :log_level, type: String, default: 'INFO'
16
16
  field :log_filename, type: String
17
+ field :run_name, type: String
17
18
 
18
19
  index({start_date: 1}, {sparse: 1, name: 'by_start'})
19
20
 
@@ -81,7 +82,13 @@ module Libis
81
82
  end
82
83
 
83
84
  def name
84
- "#{self.job.name}-#{self.id.generation_time.strftime('%Y%m%d-%H%M%S')}-#{self.id.to_s[8..-1]}" rescue self.id.to_s
85
+ [
86
+ (self.run_name || self.job.name),
87
+ self.id.generation_time.strftime('%Y%m%d-%H%M%S'),
88
+ self.id.to_s[8..-1]
89
+ ].reject { |x| x.blank? }.join('-')
90
+ rescue
91
+ self.id.to_s
85
92
  end
86
93
 
87
94
  end
@@ -1,7 +1,7 @@
1
1
  module Libis
2
2
  module Workflow
3
3
  module Mongoid
4
- VERSION = '2.0.22' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
4
+ VERSION = '2.0.23' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libis-workflow-mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.22
4
+ version: 2.0.23
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-06-02 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libis-workflow
@@ -177,4 +177,3 @@ test_files:
177
177
  - spec/test_job.rb
178
178
  - spec/test_workflow.rb
179
179
  - spec/workflow_spec.rb
180
- has_rdoc: