machine 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/machine/linux/info.rb +5 -1
- data/lib/machine/process_status.rb +10 -1
- data/lib/machine/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f1bb892405863d3dcd07161e20bbc44d5bc6614
|
4
|
+
data.tar.gz: fcb74daf1c84f1f81a235f64a0c12f4333710a1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d1521233f0c509cac321c9ea6700e93cc6b3ac563d2609f17a850514bdb5df9bff035f41e1c9e6f476ef535ec77cb1cb14812c1a66fc8ddff57c13b41207264
|
7
|
+
data.tar.gz: ca2f07ed93c0ceb794f60879b1dc4dbbeb981de16750e851d48b1e5663136f336530b1d94848b3bc97e925aa6023943686140461248851aa454add9fa5ab6f78
|
data/lib/machine/linux/info.rb
CHANGED
@@ -3,6 +3,15 @@ require 'sys/proctable'
|
|
3
3
|
require 'delegate'
|
4
4
|
|
5
5
|
module Machine
|
6
|
+
class NullObject
|
7
|
+
def method_missing(name, *args, &block)
|
8
|
+
nil
|
9
|
+
end
|
10
|
+
|
11
|
+
def respond_to?(name)
|
12
|
+
true
|
13
|
+
end
|
14
|
+
end
|
6
15
|
class ProcessStatus < SimpleDelegator
|
7
16
|
include Sys
|
8
17
|
include Helpers
|
@@ -10,7 +19,7 @@ module Machine
|
|
10
19
|
attr_reader :pid
|
11
20
|
|
12
21
|
def initialize(pid)
|
13
|
-
super ProcTable.ps(@pid = pid)
|
22
|
+
super ProcTable.ps(@pid = pid) || NullObject.new
|
14
23
|
end
|
15
24
|
|
16
25
|
end
|
data/lib/machine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chatgris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sys-proctable
|
@@ -64,3 +64,4 @@ signing_key:
|
|
64
64
|
specification_version: 4
|
65
65
|
summary: Machine collects some informations about cpu, memory, processes.
|
66
66
|
test_files: []
|
67
|
+
has_rdoc:
|