themigrator 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/themigrator/runner.rb +9 -4
- data/lib/themigrator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afdd3a14635ec5e8007efba0c1ae097c31e2427f
|
4
|
+
data.tar.gz: ffe49a85af153af72248695c210b877f8a288191
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f8233596e05c8a843b66b8aef4842f1d9258858e0c0c89ad68e879c363919861e970339f3da2d4277f61bb9526a2147e3e1d0659451e0d815b09a0ca0577b31
|
7
|
+
data.tar.gz: 98114b0bf9e4b8568901733457fa099aea37f3a7a0f1ff5fe802aef639b5c51a78f7ede0999d2aac9867f09c30330a7fb5a4e995f7fd8e03f0860679fe276569
|
data/lib/themigrator/runner.rb
CHANGED
@@ -24,14 +24,14 @@ module Themigrator
|
|
24
24
|
wd_dir = File.dirname(script)
|
25
25
|
log_fd = File.open(log_file, "w", 0600)
|
26
26
|
pid = Process.spawn(script, err: log_fd, out: log_fd, chdir: wd_dir)
|
27
|
-
|
27
|
+
add_pid(pid)
|
28
28
|
end
|
29
29
|
|
30
30
|
def wait
|
31
|
-
|
31
|
+
processes.each do |pid|
|
32
32
|
pid, status = Process.wait2(pid)
|
33
33
|
return_code = status.exitstatus
|
34
|
-
|
34
|
+
remove_pid(pid)
|
35
35
|
|
36
36
|
if return_code != 0
|
37
37
|
raise ActionFailedException.new(pid)
|
@@ -44,10 +44,15 @@ module Themigrator
|
|
44
44
|
def processes
|
45
45
|
@processes || []
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
|
+
def add_pid(pid)
|
48
49
|
@processes ||= []
|
49
50
|
@processes << pid
|
50
51
|
end
|
52
|
+
|
53
|
+
def remove_pid(pid)
|
54
|
+
@processes.delete(pid)
|
55
|
+
end
|
51
56
|
|
52
57
|
end
|
53
58
|
end
|
data/lib/themigrator/version.rb
CHANGED