datacenter 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Rakefile +1 -1
- data/lib/datacenter/process.rb +15 -2
- data/lib/datacenter/version.rb +1 -1
- data/spec/commands.yml +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b9838e31812f9c70c3145ff4090cc8a88e6fbd2
|
4
|
+
data.tar.gz: 97a959f4dff70ca1d99d10078d8a66e1ae6bd0c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8014361ebf16ef67310859cc67427503d54766c0c98e89542f3fb0b923c7537addf6ff61ea3c72bd82c72fa7172b7b6b36f35457dcfaf1b0dfc3431fa34d4290
|
7
|
+
data.tar.gz: 1aa978f896a19e9462612e28daf359a240237582de4b109a53c57d14051ee2f968448d27f404cfd37150281cfd796f9daa37594e929b32000e70290014f019f5
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby 2.
|
1
|
+
ruby 2.1.10
|
data/Rakefile
CHANGED
data/lib/datacenter/process.rb
CHANGED
@@ -29,7 +29,16 @@ module Datacenter
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def alive?
|
32
|
-
|
32
|
+
command = %Q{
|
33
|
+
if [ -d "#{proc_dir}" ]; then
|
34
|
+
echo -n "true"
|
35
|
+
else
|
36
|
+
echo -n "false"
|
37
|
+
fi
|
38
|
+
}
|
39
|
+
|
40
|
+
alive = shell.run(command) == 'true'
|
41
|
+
|
33
42
|
Datacenter.logger.info(self.class) { "pid: #{pid} - ALIVE: #{alive}" } if !alive
|
34
43
|
alive
|
35
44
|
end
|
@@ -62,8 +71,12 @@ module Datacenter
|
|
62
71
|
end
|
63
72
|
end
|
64
73
|
|
74
|
+
def proc_dir
|
75
|
+
File.join '/proc', pid.to_s
|
76
|
+
end
|
77
|
+
|
65
78
|
def proc_file(name)
|
66
|
-
filename = File.join
|
79
|
+
filename = File.join proc_dir, name.to_s
|
67
80
|
shell.run "cat #{filename}"
|
68
81
|
end
|
69
82
|
|
data/lib/datacenter/version.rb
CHANGED
data/spec/commands.yml
CHANGED
@@ -154,4 +154,10 @@
|
|
154
154
|
VmLib: 27732 kB
|
155
155
|
VmPTE: 556 kB
|
156
156
|
VmSwap: 0 kB
|
157
|
-
Threads: 4
|
157
|
+
Threads: 4
|
158
|
+
|
159
|
+
"\n if [ -d \"/proc/-22803\" ]; then \n echo -n \"true\"\n else\n echo -n \"false\"\n fi\n ": |
|
160
|
+
false
|
161
|
+
|
162
|
+
"\n if [ -d \"/proc/22803\" ]; then \n echo -n \"true\"\n else\n echo -n \"false\"\n fi\n ": |
|
163
|
+
true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datacenter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|