libis-workflow-mongoid 2.0.beta.11 → 2.0.beta.12
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: 2142a37ef9b2515d6f174ba669096ad0e7a069f4
|
4
|
+
data.tar.gz: da025b55d4239d74c0dfb93ff98c37f8965e6068
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b101d3e133a0db6e106cf16c0a84a4312a31975331d193e770748230f271ae87e714596556a2e750974a47037f6fefe7273f861adde360ef593dfb997de885bf
|
7
|
+
data.tar.gz: 6cf53db7edd79bd3a018e6d5b77655bff52c22ce4b0755fb3da7e26d18a3d785468fba4ce22bfb9f21974fffe747b89508cdcaef0dba38b6262c9d00a75c18dd
|
data/.travis.yml
CHANGED
@@ -4,6 +4,8 @@ require 'mongoid/document'
|
|
4
4
|
require 'mongoid_indifferent_access'
|
5
5
|
require_relative 'sequence'
|
6
6
|
|
7
|
+
require 'active_support/core_ext/object/deep_dup'
|
8
|
+
|
7
9
|
module Libis
|
8
10
|
module Workflow
|
9
11
|
module Mongoid
|
@@ -27,6 +29,17 @@ module Libis
|
|
27
29
|
new_obj.copy_attributes(self)
|
28
30
|
end
|
29
31
|
|
32
|
+
def info
|
33
|
+
self.attributes.deep_dup.reject { |k,v| v.blank? || volatile_attributes.include?(k) }.to_hash
|
34
|
+
end
|
35
|
+
|
36
|
+
protected
|
37
|
+
|
38
|
+
def volatile_attributes
|
39
|
+
%w'_id c_at'
|
40
|
+
end
|
41
|
+
private
|
42
|
+
|
30
43
|
def copy_attributes(other)
|
31
44
|
self.set(
|
32
45
|
other.attributes.reject do |k, _|
|
@@ -21,11 +21,9 @@ module Libis
|
|
21
21
|
field :start_date, type: Time, default: -> { Time.now }
|
22
22
|
|
23
23
|
set_callback(:destroy, :before) do |document|
|
24
|
-
document.items.each { |item| item.destroy
|
24
|
+
document.items.each { |item| item.destroy }
|
25
25
|
wd = document.work_dir
|
26
26
|
FileUtils.rmtree wd if wd && !wd.blank? && Dir.exist?(wd)
|
27
|
-
id = document.properties[:ingest_dir]
|
28
|
-
FileUtils.rmtree id if id && !id.blank? && Dir.exist?(id)
|
29
27
|
end
|
30
28
|
|
31
29
|
index start_date: 1
|
@@ -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.12' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'libis/workflow/base/workflow'
|
4
4
|
require 'libis/workflow/mongoid/base'
|
5
5
|
require 'libis/tools/config_file'
|
6
|
+
require 'libis/tools/extend/hash'
|
6
7
|
|
7
8
|
module Libis
|
8
9
|
module Workflow
|
@@ -33,7 +34,7 @@ module Libis
|
|
33
34
|
config << file_or_hash
|
34
35
|
return nil if config.empty?
|
35
36
|
workflow = self.new
|
36
|
-
workflow.configure(config.
|
37
|
+
workflow.configure(config.to_hash.key_strings_to_symbols(recursive: true))
|
37
38
|
workflow
|
38
39
|
end
|
39
40
|
|
data/spec/workflow_spec.rb
CHANGED
@@ -88,7 +88,7 @@ describe 'TestWorkflow' do
|
|
88
88
|
|
89
89
|
it 'should camelize the workitem name' do
|
90
90
|
|
91
|
-
expect(run.options[:
|
91
|
+
expect(run.options['CollectFiles'][:location]).to eq dirname
|
92
92
|
expect(run.items.count).to eq 1
|
93
93
|
expect(run.items.first.class).to eq TestDirItem
|
94
94
|
expect(run.items.first.count).to eq 4
|
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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kris Dekeyser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libis-workflow
|