linux_stat 1.1.1 → 1.3.0
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 +4 -4
- data/README.md +108 -64
- data/ext/sysconf/sysconf.c +11 -0
- data/lib/linux_stat.rb +1 -0
- data/lib/linux_stat/battery.rb +2 -0
- data/lib/linux_stat/bios.rb +2 -0
- data/lib/linux_stat/cpu.rb +2 -0
- data/lib/linux_stat/filesystem.rb +2 -0
- data/lib/linux_stat/kernel.rb +2 -0
- data/lib/linux_stat/memory.rb +9 -7
- data/lib/linux_stat/mounts.rb +5 -3
- data/lib/linux_stat/net.rb +6 -4
- data/lib/linux_stat/os.rb +50 -15
- data/lib/linux_stat/pci.rb +61 -56
- data/lib/linux_stat/prettify_bytes.rb +7 -0
- data/lib/linux_stat/process.rb +48 -23
- data/lib/linux_stat/process_info.rb +7 -0
- data/lib/linux_stat/swap.rb +6 -4
- data/lib/linux_stat/thermal.rb +122 -0
- data/lib/linux_stat/usb.rb +52 -48
- data/lib/linux_stat/user.rb +6 -3
- data/lib/linux_stat/version.rb +1 -1
- metadata +3 -2
data/lib/linux_stat/user.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
module LinuxStat
|
2
|
+
# Shows various User related information of the current system.
|
3
|
+
|
2
4
|
module User
|
3
5
|
class << self
|
4
6
|
##
|
@@ -55,6 +57,7 @@ module LinuxStat
|
|
55
57
|
# But if the status isn't available it will return an empty Hash.
|
56
58
|
def gids
|
57
59
|
return {} unless passwd_readable?
|
60
|
+
|
58
61
|
passwd_splitted.reduce({}) { |h, x|
|
59
62
|
h.merge!(x[0].to_sym => x[3].to_i)
|
60
63
|
}
|
@@ -103,7 +106,7 @@ module LinuxStat
|
|
103
106
|
|
104
107
|
uid, gid = LinuxStat::Sysconf.get_uid, LinuxStat::Sysconf.get_gid
|
105
108
|
|
106
|
-
username = ''
|
109
|
+
username = ''.freeze
|
107
110
|
passwd.each { |x|
|
108
111
|
splitted = x.split(?:).freeze
|
109
112
|
if splitted[2].to_i == uid && splitted[3].to_i == gid
|
@@ -187,7 +190,7 @@ module LinuxStat
|
|
187
190
|
def username_by_gid(gid = get_gid)
|
188
191
|
return ''.freeze unless passwd_readable?
|
189
192
|
|
190
|
-
username = ''
|
193
|
+
username = ''.freeze
|
191
194
|
passwd.each do |x|
|
192
195
|
splitted = x.split(?:.freeze)
|
193
196
|
if splitted[2].to_i == gid
|
@@ -314,7 +317,7 @@ module LinuxStat
|
|
314
317
|
def home_by_gid(id = get_gid)
|
315
318
|
return ''.freeze unless passwd_readable?
|
316
319
|
|
317
|
-
home = ''
|
320
|
+
home = ''.freeze
|
318
321
|
passwd.each do |x|
|
319
322
|
splitted = x.split(?:.freeze)
|
320
323
|
|
data/lib/linux_stat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linux_stat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sourav Goswami
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Linux only, efficient linux system utilization reporting and system monitoring
|
14
14
|
gem
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- lib/linux_stat/process.rb
|
53
53
|
- lib/linux_stat/process_info.rb
|
54
54
|
- lib/linux_stat/swap.rb
|
55
|
+
- lib/linux_stat/thermal.rb
|
55
56
|
- lib/linux_stat/usb.rb
|
56
57
|
- lib/linux_stat/user.rb
|
57
58
|
- lib/linux_stat/version.rb
|