libis-workflow 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/libis/workflow/base/file_item.rb +13 -13
- data/lib/libis/workflow/base/job.rb +2 -2
- data/lib/libis/workflow/base/run.rb +2 -2
- data/lib/libis/workflow/base/work_item.rb +1 -1
- data/lib/libis/workflow/base/workflow.rb +5 -3
- data/lib/libis/workflow/run.rb +1 -1
- data/lib/libis/workflow/task.rb +1 -0
- data/lib/libis/workflow/tasks/analyzer.rb +1 -1
- data/lib/libis/workflow/version.rb +1 -1
- data/spec/items/test_dir_item.rb +1 -1
- data/spec/items/test_file_item.rb +1 -1
- data/spec/tasks/camelize_name.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4811293c017ab0613375ec887877536727046749
|
4
|
+
data.tar.gz: b8180f2d746875ff2475c7760cb31d2c58e781fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55849f68aa4bc0c2c22a7483f361ed47bdee6fb896cf561a81af2df9425865dfe08805e8fb05fe966bec66cd7e02d9df1482fc015267dc5e94a234c88ce2c57c
|
7
|
+
data.tar.gz: bfe38e532a17aad2ad86ae6d2c0731b8f94a0542432fc84559361c1235343f8181d2140ac2b0577d4b4687a7ac0d6a52db66ae8be8abfa118e9c947206b413a7
|
data/README.md
CHANGED
@@ -214,11 +214,11 @@ Work items that are file-based can derive from the ::Libis::Workflow::FileItem c
|
|
214
214
|
end
|
215
215
|
|
216
216
|
def filesize
|
217
|
-
properties[
|
217
|
+
properties[:size]
|
218
218
|
end
|
219
219
|
|
220
220
|
def fixity_check(checksum)
|
221
|
-
properties[
|
221
|
+
properties[:checksum] == checksum
|
222
222
|
end
|
223
223
|
|
224
224
|
end
|
@@ -239,11 +239,11 @@ or include the ::Libis::Workflow::Base::FileItem module:
|
|
239
239
|
end
|
240
240
|
|
241
241
|
def filesize
|
242
|
-
properties[
|
242
|
+
properties[:size]
|
243
243
|
end
|
244
244
|
|
245
245
|
def fixity_check(checksum)
|
246
|
-
properties[
|
246
|
+
properties[:checksum] == checksum
|
247
247
|
end
|
248
248
|
|
249
249
|
end
|
@@ -13,11 +13,11 @@ module Libis
|
|
13
13
|
include Libis::Workflow::Base::WorkItem
|
14
14
|
|
15
15
|
def filename
|
16
|
-
File.basename(self.properties[
|
16
|
+
File.basename(self.properties[:filename]) || self.properties[:link]
|
17
17
|
end
|
18
18
|
|
19
19
|
def name
|
20
|
-
self.properties[
|
20
|
+
self.properties[:name] || self.filename
|
21
21
|
end
|
22
22
|
|
23
23
|
def filelist
|
@@ -29,24 +29,24 @@ module Libis
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def fullpath
|
32
|
-
self.properties[
|
32
|
+
self.properties[:filename]
|
33
33
|
end
|
34
34
|
|
35
35
|
def filename=(name)
|
36
36
|
begin
|
37
37
|
stats = ::File.stat name
|
38
|
-
self.properties[
|
39
|
-
self.properties[
|
40
|
-
self.properties[
|
41
|
-
self.properties[
|
42
|
-
self.properties[
|
43
|
-
self.properties[
|
44
|
-
self.properties[
|
38
|
+
self.properties[:size] = stats.size
|
39
|
+
self.properties[:access_time] = stats.atime
|
40
|
+
self.properties[:modification_time] = stats.mtime
|
41
|
+
self.properties[:creation_time] = stats.ctime
|
42
|
+
self.properties[:mode] = stats.mode
|
43
|
+
self.properties[:uid] = stats.uid
|
44
|
+
self.properties[:gid] = stats.gid
|
45
45
|
set_checksum(:MD5, ::Digest::MD5.hexdigest(File.read(name))) if File.file?(name)
|
46
46
|
rescue
|
47
47
|
# ignored
|
48
48
|
end
|
49
|
-
self.properties[
|
49
|
+
self.properties[:filename] = name
|
50
50
|
end
|
51
51
|
|
52
52
|
def checksum(checksum_type)
|
@@ -58,11 +58,11 @@ module Libis
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def link
|
61
|
-
self.properties[
|
61
|
+
self.properties[:link]
|
62
62
|
end
|
63
63
|
|
64
64
|
def link=(name)
|
65
|
-
self.properties[
|
65
|
+
self.properties[:link] = name
|
66
66
|
end
|
67
67
|
|
68
68
|
def set_info(info)
|
@@ -49,7 +49,6 @@ module Libis
|
|
49
49
|
self.name ||= ''
|
50
50
|
self.description ||= ''
|
51
51
|
self.input ||= {}
|
52
|
-
|
53
52
|
self.name = cfg[:name] if cfg.has_key?(:name)
|
54
53
|
self.description = cfg[:description] if cfg.has_key?(:description)
|
55
54
|
self.workflow = cfg[:workflow] if cfg.has_key?(:workflow)
|
@@ -64,8 +63,9 @@ module Libis
|
|
64
63
|
raise RuntimeError.new "Could not create instance of run object '#{self.run_object}'" unless run
|
65
64
|
|
66
65
|
run.job = self
|
66
|
+
opts.key_strings_to_symbols!(recursive: true)
|
67
67
|
(opts.delete(:run_config) || {}).each { |key,value| run.send(key, value) }
|
68
|
-
run.options
|
68
|
+
run.options.merge!(self.input.merge(opts))
|
69
69
|
run.save
|
70
70
|
|
71
71
|
run.run
|
@@ -50,7 +50,7 @@ module Libis
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def logger
|
53
|
-
self.properties[
|
53
|
+
self.properties[:logger] || self.job.logger rescue ::Libis::Workflow::Config.logger
|
54
54
|
end
|
55
55
|
|
56
56
|
# Execute the workflow.
|
@@ -65,7 +65,7 @@ module Libis
|
|
65
65
|
def run(action = :run)
|
66
66
|
self.action = action
|
67
67
|
|
68
|
-
self.start_date = Time.now
|
68
|
+
self.start_date = Time.now unless action == :retry
|
69
69
|
|
70
70
|
self.options = workflow.prepare_input(self.options)
|
71
71
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'libis/tools/parameter'
|
4
4
|
require 'libis/workflow/task_group'
|
5
|
+
require 'libis/tools/extend/hash'
|
5
6
|
|
6
7
|
module Libis
|
7
8
|
module Workflow
|
@@ -73,7 +74,6 @@ module Libis
|
|
73
74
|
end
|
74
75
|
|
75
76
|
def self.included(base)
|
76
|
-
|
77
77
|
base.extend ClassMethods
|
78
78
|
end
|
79
79
|
|
@@ -85,7 +85,9 @@ module Libis
|
|
85
85
|
|
86
86
|
self.class.require_all
|
87
87
|
|
88
|
-
unless self.config[:tasks].
|
88
|
+
unless !self.config[:tasks].empty? &&
|
89
|
+
self.config[:tasks].last[:class] &&
|
90
|
+
self.config[:tasks].last[:class].split('::').last == 'Analyzer'
|
89
91
|
self.config[:tasks] << {class: '::Libis::Workflow::Tasks::Analyzer'}
|
90
92
|
end
|
91
93
|
|
@@ -124,7 +126,7 @@ module Libis
|
|
124
126
|
task_name, param_name = target.split('#')
|
125
127
|
param_name ||= key
|
126
128
|
result[task_name] ||= {}
|
127
|
-
result[task_name][param_name
|
129
|
+
result[task_name][param_name] = value
|
128
130
|
end
|
129
131
|
end
|
130
132
|
result
|
data/lib/libis/workflow/run.rb
CHANGED
data/lib/libis/workflow/task.rb
CHANGED
@@ -14,7 +14,7 @@ module Libis
|
|
14
14
|
# @param [Libis::Workflow::Base::WorkItem] item
|
15
15
|
def run(item)
|
16
16
|
|
17
|
-
item.properties[
|
17
|
+
item.properties[:ingest_failed] = item.check_status(:FAILED)
|
18
18
|
|
19
19
|
item.summary = {}
|
20
20
|
item.log_history.each do |log|
|
@@ -2,6 +2,6 @@
|
|
2
2
|
|
3
3
|
module Libis
|
4
4
|
module Workflow
|
5
|
-
VERSION = '2.0.
|
5
|
+
VERSION = '2.0.3' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
|
6
6
|
end
|
7
7
|
end
|
data/spec/items/test_dir_item.rb
CHANGED
data/spec/tasks/camelize_name.rb
CHANGED
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.
|
4
|
+
version: 2.0.3
|
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-03-
|
11
|
+
date: 2016-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|