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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 019f835ac47e780131ce4a171866b50d070bd9eb
4
- data.tar.gz: fc334d6b1ac38a447ed9bac873870f5ca0d647ac
3
+ metadata.gz: 8b9838e31812f9c70c3145ff4090cc8a88e6fbd2
4
+ data.tar.gz: 97a959f4dff70ca1d99d10078d8a66e1ae6bd0c8
5
5
  SHA512:
6
- metadata.gz: 593b837bb8cb9e294df5ddb77aebf64d8e6c8519353b7ef3765407b5da91a965ea4e49321d50c587e7a2d24a483a3e4e42019aa0db1c8d934cdcc8d7605fa738
7
- data.tar.gz: 3ccd7243885932720d4d38d83ed237f1dab19d7e6833197c83f07afddc4bfdafcd2bcea1b971a63b3c6d60e4f8bf3c30ee788ff8a0472c1f1148501700d4dcc3
6
+ metadata.gz: 8014361ebf16ef67310859cc67427503d54766c0c98e89542f3fb0b923c7537addf6ff61ea3c72bd82c72fa7172b7b6b36f35457dcfaf1b0dfc3431fa34d4290
7
+ data.tar.gz: 1aa978f896a19e9462612e28daf359a240237582de4b109a53c57d14051ee2f968448d27f404cfd37150281cfd796f9daa37594e929b32000e70290014f019f5
@@ -1 +1 @@
1
- ruby 2.0
1
+ ruby 2.1.10
data/Rakefile CHANGED
@@ -18,7 +18,7 @@ task default: :spec
18
18
 
19
19
  desc 'Pry console'
20
20
  task :console do
21
- require 'rasti-db'
21
+ require 'datacenter'
22
22
  require 'pry'
23
23
  ARGV.clear
24
24
  Pry.start
@@ -29,7 +29,16 @@ module Datacenter
29
29
  end
30
30
 
31
31
  def alive?
32
- alive = !shell.run("ps -p #{pid} | grep #{pid}").empty?
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 '/proc', pid.to_s, name.to_s
79
+ filename = File.join proc_dir, name.to_s
67
80
  shell.run "cat #{filename}"
68
81
  end
69
82
 
@@ -1,3 +1,3 @@
1
1
  module Datacenter
2
- VERSION = '0.4.3'
2
+ VERSION = '0.4.4'
3
3
  end
@@ -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.3
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-03-07 00:00:00.000000000 Z
11
+ date: 2018-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh