ree_spec 0.0.3 → 0.0.4

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
  SHA256:
3
- metadata.gz: 2330ca193f98ea3b63c7a282b2a6f2b0a10badc4809c8d669c47d52aeb67d26d
4
- data.tar.gz: 74d1e118e28177425384080f073b7f627f207d5813f60f545282c9660c03bb42
3
+ metadata.gz: 68eb3e82ab6595a8e4115ecfccea6c639c7d4de80a8c2daf4a33bb2fd68b2c3f
4
+ data.tar.gz: 9b31bb1cb252ba420461afd259e108fa77e1388f8e18a50c1377d6f7e7e4d5c2
5
5
  SHA512:
6
- metadata.gz: b5274c26cf4e175d53e7b26f227abaedc59b1a0ce60e10cc44e182cfa49484e2f0ce3e63e1cc963c51bc1efdc2a4a2afe49fc0df6e3ffacf100aa75dd35e4a96
7
- data.tar.gz: 6e27ee7378246f214b29476c6f048ba993be80a9a47fdb52a6f9833528be06f735d152e516c22052dc007e47254fd9e8ee78836db9f40bd462c761128605b9ef
6
+ metadata.gz: 53a62c797bc3d2419a5fb8c53a4905aac5660be16a8916f8309c44ad569b8fc407081808621aeb4713cecb3c999ae222d73b0b653794aeebefb87fa9621770ce
7
+ data.tar.gz: 2e81850bedb0f88b5ddf72c779160f45b2627f6141b10b1ccbf6225150489dca3b5a4e88021fb380bd3b314e495881332b3fc3519893605dbed1a8b39fcd8388
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree_spec (0.0.3)
4
+ ree_spec (0.0.4)
5
5
  commander (~> 5.0.0)
6
6
  ree (~> 1.0.47)
7
7
  ree_lib (~> 1.0.124)
@@ -58,9 +58,30 @@ class ReeSpecCli::RunSpecs
58
58
  result[i+1] = nil
59
59
  end
60
60
 
61
+ ['INT', 'TERM'].each do |signal|
62
+ trap(signal) do
63
+ shutdown(processes)
64
+ exit
65
+ end
66
+ end
67
+
61
68
  result
62
69
  end
63
70
 
71
+ def shutdown(processes)
72
+ processes.each do |number, pid|
73
+ Process.kill('TERM', pid) if !pid.nil?
74
+ rescue Errno::ESRCH
75
+ end
76
+
77
+ processes.each do |number, pid|
78
+ Process.wait(pid) if !pid.nil?
79
+ rescue Errno::ECHILD
80
+ end
81
+
82
+ puts "All child processes terminated"
83
+ end
84
+
64
85
  def print_start_message(job)
65
86
  puts("\n**** Running #{job.files.size} spec#{job.files.size == 1 ? "" : "s"} for #{job.package.name} ****\n")
66
87
  end
@@ -92,15 +113,9 @@ class ReeSpecCli::RunSpecs
92
113
  return process.first
93
114
  end
94
115
 
95
- number = nil
96
-
97
- processes.each do |k, v|
98
- Process.wait(v)
99
- processes[k] = nil
100
- number = k
101
- break
102
- end
103
-
116
+ pid = Process.wait
117
+ number = processes.find { |_, v| v == pid }
118
+ processes[number] = nil
104
119
  number
105
120
  end
106
121
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReeSpec
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ree_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov