ree_spec 0.0.3 → 0.0.5

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: 31fc4911be2ef72173d82b4d81ed810cf02db09bd91efd8c5181537745aaf9a5
4
+ data.tar.gz: 13f654e48d93ea78b7beae3d6fc499d2d2c35bf36f099e482ca44b957114894c
5
5
  SHA512:
6
- metadata.gz: b5274c26cf4e175d53e7b26f227abaedc59b1a0ce60e10cc44e182cfa49484e2f0ce3e63e1cc963c51bc1efdc2a4a2afe49fc0df6e3ffacf100aa75dd35e4a96
7
- data.tar.gz: 6e27ee7378246f214b29476c6f048ba993be80a9a47fdb52a6f9833528be06f735d152e516c22052dc007e47254fd9e8ee78836db9f40bd462c761128605b9ef
6
+ metadata.gz: ff794e13034853d5edf9518a3ba7548348710030ece9327cbdd5f56f89b662f6d67db60511b78aca397c42daaaa6694d028f272ec71c7f5e8e458cc7f00dd20b
7
+ data.tar.gz: 988f45cf4d197284bfae26c42e255a226952bc150a5cf448cf062863137cc968b6d425aaaa775f139828b490f24c75c66fb8003a7a6824f27ef3ffab4610c45d
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.5)
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 }.first
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.5"
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.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov