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.
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module LinuxStat
2
- VERSION ||= "1.1.1"
2
+ VERSION ||= "1.3.0"
3
3
  end
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.1.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-28 00:00:00.000000000 Z
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