process_controller 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e82cb5fc19f23bc7ed59704b5a9e3bd0014b1a34
4
- data.tar.gz: 3ec5fa2a46883159e692061ee0d57142690fd83c
3
+ metadata.gz: 1ef8000f8d7b5a76ce3fa48552b86ab01c8febe9
4
+ data.tar.gz: 1450383d5af4520afc9dace95920ba5103336dea
5
5
  SHA512:
6
- metadata.gz: 291f66be7f506bb90c6ce6c72aec972c623783095e045a0a1c400b1acf9feaaf530f6bb6da516c2a8fa3a7efd070581414895b2383693df0a8dbead6c5454f38
7
- data.tar.gz: 970656a2d164fb81e98b4e5cd8f18092a83db5d0234babb37069962ff7db5ee4d292324cb09e72984b7b321d3d68e80fbe913ea2b09c2bfb1888476992b589c4
6
+ metadata.gz: 245ad27c2b77e72fa960cad2ad97f51524ddfac62153bf8ca81a0704fc40ed31761a8b2141d19c988b80196dc623cf29bf94fd363a15469cea3632410fa489cc
7
+ data.tar.gz: 138e40ed8b6478b5284f5d6b0315cda7835afb80f1b4de6332fc3f3016839470d1af05782814a049a10ac1c16334567aeb3b1e3476580fcefa06ed60bfbb72fa
@@ -1,3 +1,3 @@
1
1
  module Control
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
@@ -118,9 +118,21 @@ module ControlHelper
118
118
  pid_filename = options.fetch(Control_P::OPTIONS_ATTRIBUTES[:pid_filename], nil)
119
119
  raise "no pid filename found in #{options}" if pid_filename.nil?
120
120
  p "working directory is #{Dir.pwd} , trying to cat #{pid_filename} , of type #{pid_filename.class}"
121
- res = `cat #{pid_filename}`
122
- p "result from cat master_pid is #{res}"
123
- '' == res
121
+ res = get_pid_from_file(pid_filename)
122
+ p "result from get_pid_from_file is #{res} , type #{res.class}"
123
+ res = make_sure_pid_is_real!(res, pid_filename) unless res.nil?
124
+ !res.nil?
125
+ end
126
+
127
+ def make_sure_pid_is_real!(pid, pid_filename)
128
+ find_pid = find_pid_with_ps(pid)
129
+ if find_pid.nil?
130
+ p "didn't really find pid running, deleting the file #{pid_filename}"
131
+ res = File.delete(pid_filename) rescue p 'failed to delete master pid'
132
+ return nil
133
+ end
134
+
135
+ find_pid
124
136
  end
125
137
 
126
138
  def kill_with_retries!(options)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: process_controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ohad partuck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-17 00:00:00.000000000 Z
11
+ date: 2015-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport