libis-workflow-mongoid 2.0.beta.19 → 2.0.beta.20
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 674a0925bea93cd6af396d621e1d2a73a29e2ffb
|
4
|
+
data.tar.gz: 8b8037e88db86b2d0c5a43b81418ac146c7f663b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd4ea904e7d5b87f731b6cb531b0d1a39446fdcba03df3078850f92f768e7925628f8b35e0d5570c3cb33dc46267307e47424ac31771ce55770a5eb4d84f0d29
|
7
|
+
data.tar.gz: cfae7c656ae1f5e52a146a8148a7c3b14a7c80de083917affe9bbce848af40cf640dce6115638037d8683b8d58ec261de60e7788acaddcb65dd5479effb5e317
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Libis
|
4
4
|
module Workflow
|
5
5
|
module Mongoid
|
6
|
-
VERSION = '2.0.beta.
|
6
|
+
VERSION = '2.0.beta.20' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -8,21 +8,6 @@ module Libis
|
|
8
8
|
|
9
9
|
module WorkItemBase
|
10
10
|
|
11
|
-
class Options
|
12
|
-
include Libis::Workflow::Mongoid::Dynamic
|
13
|
-
embedded_in :work_item, class_name: 'Libis::Workflow::Mongoid::WorkItem'
|
14
|
-
end
|
15
|
-
|
16
|
-
class Properties
|
17
|
-
include Libis::Workflow::Mongoid::Dynamic
|
18
|
-
embedded_in :work_item, class_name: 'Libis::Workflow::Mongoid::WorkItem'
|
19
|
-
end
|
20
|
-
|
21
|
-
class Summary
|
22
|
-
include Libis::Workflow::Mongoid::Dynamic
|
23
|
-
embedded_in :work_item, class_name: 'Libis::Workflow::Mongoid::WorkItem'
|
24
|
-
end
|
25
|
-
|
26
11
|
def self.included(klass)
|
27
12
|
klass.class_eval do
|
28
13
|
include Libis::Workflow::Base::WorkItem
|
@@ -30,9 +15,9 @@ module Libis
|
|
30
15
|
|
31
16
|
store_in collection: 'workflow_items'
|
32
17
|
|
33
|
-
|
34
|
-
|
35
|
-
|
18
|
+
field :options, type: Hash, default: -> { Hash.new }
|
19
|
+
field :properties, type: Hash, default: -> { Hash.new }
|
20
|
+
field :summary, type: Hash, default: -> { Hash.new }
|
36
21
|
|
37
22
|
has_many :logs, as: :logger, class_name: Libis::Workflow::Mongoid::LogEntry.to_s,
|
38
23
|
dependent: :destroy, autosave: true, order: :_id.asc do
|
@@ -55,12 +40,6 @@ module Libis
|
|
55
40
|
document.logs.each { |log| log.destroy! }
|
56
41
|
end
|
57
42
|
|
58
|
-
set_callback(:initialize, :after) do |document|
|
59
|
-
document.options = {}
|
60
|
-
document.properties = {}
|
61
|
-
document.summary = {}
|
62
|
-
end
|
63
|
-
|
64
43
|
end
|
65
44
|
end
|
66
45
|
|
data/spec/items/test_dir_item.rb
CHANGED
@@ -15,15 +15,15 @@ class TestFileItem < TestItem
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def name
|
18
|
-
self.properties[
|
18
|
+
self.properties['name'] || super
|
19
19
|
end
|
20
20
|
|
21
21
|
def filesize
|
22
|
-
properties[
|
22
|
+
properties['size']
|
23
23
|
end
|
24
24
|
|
25
25
|
def fixity_check(checksum)
|
26
|
-
properties[
|
26
|
+
properties['checksum'] == checksum
|
27
27
|
end
|
28
28
|
|
29
29
|
end
|
data/spec/tasks/camelize_name.rb
CHANGED
data/spec/workflow_spec.rb
CHANGED
@@ -88,7 +88,8 @@ describe 'TestWorkflow' do
|
|
88
88
|
|
89
89
|
it 'should camelize the workitem name' do
|
90
90
|
|
91
|
-
|
91
|
+
puts run.options
|
92
|
+
expect(run.options['CollectFiles']['location']).to eq dirname
|
92
93
|
|
93
94
|
expect(run.items.size).to eq 1
|
94
95
|
expect(run.items.count).to eq 1
|
@@ -110,13 +111,13 @@ describe 'TestWorkflow' do
|
|
110
111
|
|
111
112
|
it 'should return expected debug output' do
|
112
113
|
|
113
|
-
expect(run.summary[
|
114
|
+
expect(run.summary['DEBUG']).to eq 23
|
114
115
|
expect(run.log_history.count).to eq 8
|
115
116
|
expect(run.status_log.count).to eq 8
|
116
117
|
item = run.items.first
|
117
118
|
expect(item.log_history.count).to eq 15
|
118
119
|
expect(item.status_log.count).to eq 6
|
119
|
-
expect(item.summary[
|
120
|
+
expect(item.summary['DEBUG']).to eq 15
|
120
121
|
|
121
122
|
sample_out = <<STR
|
122
123
|
DEBUG -- CollectFiles - TestRun : Processing subitem (1/1): items
|
@@ -188,8 +189,8 @@ STR
|
|
188
189
|
item = run.items.first
|
189
190
|
expect(item.nil?).to eq false
|
190
191
|
expect(item.is_a? TestDirItem).to eq true
|
191
|
-
expect(item.properties[
|
192
|
-
expect(item.properties[
|
192
|
+
expect(item.properties['name']).to eq 'Items'
|
193
|
+
expect(item.properties['ingest_failed']).to eq false
|
193
194
|
end
|
194
195
|
|
195
196
|
it 'move item in relation' do
|
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.beta.
|
4
|
+
version: 2.0.beta.20
|
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-01-
|
11
|
+
date: 2016-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libis-workflow
|