ree_spec 0.0.2 → 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: 80270a0c46cda1978c0b70c75f34267563a940faf968f8527b3fbda6e805a83e
4
- data.tar.gz: e0bf26ed05211cbda7c1b97486e5a07a43e4f81b6fa29ea05158dba662361ef6
3
+ metadata.gz: 68eb3e82ab6595a8e4115ecfccea6c639c7d4de80a8c2daf4a33bb2fd68b2c3f
4
+ data.tar.gz: 9b31bb1cb252ba420461afd259e108fa77e1388f8e18a50c1377d6f7e7e4d5c2
5
5
  SHA512:
6
- metadata.gz: a95f7eb26647f0eebf30a5bd79ce365dd038c1e756468d5db92f3e51880edab16b8ae1dec8b424a154d32b57399546fda09482c1be0682bd64a5572c06beea77
7
- data.tar.gz: 3c90bfdbe352241753bc0064e20dd9540dd36c71ec6a074858af56a95f76b381fe79f2f3c6c4bec6b72998887dd9322c135e0625b33258242b51bf181e849413
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.2)
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)
@@ -55,12 +55,33 @@ class ReeSpecCli::RunSpecs
55
55
  result = {}
56
56
 
57
57
  process_count.times do |i|
58
- result[i] = nil
58
+ result[i+1] = nil
59
+ end
60
+
61
+ ['INT', 'TERM'].each do |signal|
62
+ trap(signal) do
63
+ shutdown(processes)
64
+ exit
65
+ end
59
66
  end
60
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.2"
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.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov