acpc_dealer 2.4.0 → 2.4.1

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
  SHA1:
3
- metadata.gz: dea56490ccff82a20e8813b2d119c9259575dded
4
- data.tar.gz: 5fcf82680db42c45104c62b7135eaba342dfcda5
3
+ metadata.gz: c4fa53f651257274bf2aef2413cce48c12293cc2
4
+ data.tar.gz: df26215d5c964c16c787474f3e3a903979eabec0
5
5
  SHA512:
6
- metadata.gz: 2144d0a98e76951268b5d26ab45eae283166eeaf509dba3924e38097ab97a7afd82877b766323bf33bdce8b1db35e68389508a76e1a870e26f8efc8185d7be32
7
- data.tar.gz: 40061dfbd06b1f45c45aeec2ac304ab0da3f3bab2be4d65d1e6792369d8a3157e7f414d186111777f0ce21deef591bcea2e7cb31ab8c303b099bb9678d6f629d
6
+ metadata.gz: b3d5cf620ff3c03cd4e1fcf9c881866288eeae0e2020dbe7a5d5ad16e8140d840e2f200f26d20a838ef0c6ef5db9613bd0da81741a376a87fe76c6136a0603c2
7
+ data.tar.gz: f315138fc37434e1941dab2c8c0adf237e7b31fa12f25ceecfbea45960a3b7220153f59509a2b9c609dcf22f7aded0a4543cf58893a27b33d0f8d9443f3cfec8
data/lib/acpc_dealer.rb CHANGED
@@ -54,11 +54,22 @@ module AcpcDealer
54
54
  "#{players.join('-')}.#{game_def}.r#{seed}.#{date}"
55
55
  end
56
56
 
57
+ def self.process_exists?(pid)
58
+ begin
59
+ Process.getpgid pid
60
+ true
61
+ rescue Errno::ESRCH
62
+ false
63
+ end
64
+ end
65
+ def self.kill_process(pid) Process.kill('TERM', pid) end
66
+ def self.force_kill_process(pid) Process.kill('KILL', pid) end
67
+
57
68
  def self.dealer_running?(dealer_process_hash)
58
69
  (
59
70
  dealer_process_hash &&
60
71
  dealer_process_hash[:pid] &&
61
- dealer_process_hash[:pid].process_exists?
72
+ process_exists?(dealer_process_hash[:pid])
62
73
  )
63
74
  end
64
75
 
@@ -80,7 +91,6 @@ module AcpcDealer
80
91
  end
81
92
  rescue Timeout::Error
82
93
  end
83
-
84
94
  return false
85
95
  end
86
96
 
@@ -1,3 +1,3 @@
1
1
  module AcpcDealer
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acpc_dealer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Morrill