vidibus-sysinfo 0.0.9 → 0.0.10
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.
data/lib/vidibus/sysinfo/core.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Vidibus
|
2
2
|
module Sysinfo
|
3
3
|
|
4
|
-
# Returns number of
|
4
|
+
# Returns number of CPUs on this system.
|
5
5
|
#
|
6
6
|
# Analyzes lscpu
|
7
7
|
#
|
@@ -9,21 +9,19 @@ module Vidibus
|
|
9
9
|
extend Base
|
10
10
|
|
11
11
|
class << self
|
12
|
-
def command
|
12
|
+
def command()
|
13
13
|
'lscpu'
|
14
14
|
end
|
15
15
|
|
16
16
|
def parse(output)
|
17
|
-
|
18
|
-
|
19
|
-
if cores && sockets
|
20
|
-
cores.to_i * sockets.to_i
|
17
|
+
if cpus = output[/CPU\(s\):\s+(\d+)/i, 1]
|
18
|
+
cpus.to_i
|
21
19
|
end
|
22
20
|
end
|
23
21
|
|
24
22
|
def explain(error)
|
25
23
|
if error.match('lscpu: command not found')
|
26
|
-
return '
|
24
|
+
return 'lscpu is not installed. On Debian you can install it with "apt-get install lscpu"'
|
27
25
|
end
|
28
26
|
end
|
29
27
|
end
|
@@ -30,7 +30,7 @@ module Vidibus
|
|
30
30
|
|
31
31
|
# Returns sum of transmitted and received bytes in megabytes.
|
32
32
|
def parse(output)
|
33
|
-
if output.match(/eth0
|
33
|
+
if output.match(/eth0\:\s*([\d\s]+)/)
|
34
34
|
numbers = $1.split(/\s+/)
|
35
35
|
received = numbers[0].to_i
|
36
36
|
transmitted = numbers[8].to_i
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vidibus-sysinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-09-
|
12
|
+
date: 2013-09-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -143,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
segments:
|
145
145
|
- 0
|
146
|
-
hash:
|
146
|
+
hash: -4266894747005125364
|
147
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
148
|
none: false
|
149
149
|
requirements:
|