libis-workflow-mongoid 2.0.beta.11 → 2.0.beta.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb77b9360af577f7b0b7f8067b0b43339a562512
4
- data.tar.gz: 40868911a55787816c6cbd9e8e2730da9e26b1f4
3
+ metadata.gz: 2142a37ef9b2515d6f174ba669096ad0e7a069f4
4
+ data.tar.gz: da025b55d4239d74c0dfb93ff98c37f8965e6068
5
5
  SHA512:
6
- metadata.gz: 64a7f3c741675179200da3beaa66d02265611afabe19dc18e3f6f293e71b8bac1c9b077b021a26e4cb76c68f403fad2c45c8d4036ab4898654783d7553e9d7ef
7
- data.tar.gz: ef4c92bc1aba840e0b7b609624203759557cea6fcbf65681a60ffae6c8131410d37d9d5ced04e988360715ead97cfb5aa3dff6517aa4813445e3f57734eb1d39
6
+ metadata.gz: b101d3e133a0db6e106cf16c0a84a4312a31975331d193e770748230f271ae87e714596556a2e750974a47037f6fefe7273f861adde360ef593dfb997de885bf
7
+ data.tar.gz: 6cf53db7edd79bd3a018e6d5b77655bff52c22ce4b0755fb3da7e26d18a3d785468fba4ce22bfb9f21974fffe747b89508cdcaef0dba38b6262c9d00a75c18dd
data/.travis.yml CHANGED
@@ -25,6 +25,8 @@ matrix:
25
25
  jdk: oraclejdk7
26
26
  - rvm: ruby-head
27
27
  jdk: oraclejdk8
28
+ allow_failures:
29
+ - rvm: ruby-head
28
30
  branches:
29
31
  only:
30
32
  - master
@@ -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.11' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
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.to_h)
37
+ workflow.configure(config.to_hash.key_strings_to_symbols(recursive: true))
37
38
  workflow
38
39
  end
39
40
 
@@ -88,7 +88,7 @@ describe 'TestWorkflow' do
88
88
 
89
89
  it 'should camelize the workitem name' do
90
90
 
91
- expect(run.options[:dirname]).to eq dirname
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.11
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-09 00:00:00.000000000 Z
11
+ date: 2015-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libis-workflow