file_pool 0.3.6 → 0.3.7

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.
@@ -1,3 +1,3 @@
1
1
  module FilePool
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
data/lib/file_pool.rb CHANGED
@@ -79,7 +79,7 @@ module FilePool
79
79
  def self.add! orig_path, options = {}
80
80
  newid = uuid
81
81
 
82
- _add = lambda do
82
+ child = fork do
83
83
  target = path newid
84
84
 
85
85
  if @@crypted_mode
@@ -103,10 +103,13 @@ module FilePool
103
103
  end
104
104
  end
105
105
 
106
+
106
107
  if options[:background]
107
- Thread.new{ _add.call }
108
+ # don't wait, avoid zombies
109
+ Process.detach(pid)
108
110
  else
109
- _add.call
111
+ # block until done
112
+ Process.waitpid(pid)
110
113
  end
111
114
 
112
115
  newid
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file_pool
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 6
10
- version: 0.3.6
9
+ - 7
10
+ version: 0.3.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - "robokopp (Robert Anni\xC3\xA9s)"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2018-10-21 00:00:00 +02:00
18
+ date: 2018-10-22 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency