utilinfo 0.1.3 → 0.1.3.1
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/lib/linux_utilinfo/environment_methods.rb +11 -11
- data/lib/linux_utilinfo/general_methods.rb +13 -13
- data/lib/linux_utilinfo/hardware_methods.rb +29 -29
- data/lib/linux_utilinfo/memory_methods.rb +10 -10
- data/lib/linux_utilinfo/operating_system_methods.rb +20 -20
- data/lib/linux_utilinfo.rb +11 -11
- data/lib/mac_utilinfo.rb +8 -10
- data/lib/utilinfo/version.rb +3 -3
- data/lib/utilinfo.rb +2 -0
- data/lib/win_utilinfo/memory_methods.rb +11 -0
- data/lib/win_utilinfo.rb +2 -6
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5ea69cdb16b3e61b7337907219e0c400bbae1e6
|
4
|
+
data.tar.gz: af8570bc9569efa184530865c06cf5076d631338
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec047e63be45dfe6c687bd8ef26e0419c9f6348e0e7f39677c1bfd2b67a00b36eebac561d96d6c7e4cba0bdbbb55713a35e5d14de40ec782af08cdb32eba5e47
|
7
|
+
data.tar.gz: ae3f081d5b4b7e8535111f2163ce9d77d40e319443383b00e668df6cb0cda9f5cff6b83ff3bf72e84b795598f87b042859e38b6a575c08bb731d9b84c7762661
|
@@ -1,11 +1,11 @@
|
|
1
|
-
module LinuxUtilinfo
|
2
|
-
module EnvironmentMethods
|
3
|
-
def get_shell
|
4
|
-
return ENV['SHELL']
|
5
|
-
end
|
6
|
-
|
7
|
-
def get_editor
|
8
|
-
return ENV['EDITOR']
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module LinuxUtilinfo
|
2
|
+
module EnvironmentMethods
|
3
|
+
def get_shell
|
4
|
+
return ENV['SHELL']
|
5
|
+
end
|
6
|
+
|
7
|
+
def get_editor
|
8
|
+
return ENV['EDITOR']
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module LinuxUtilinfo
|
2
|
-
module GeneralMethods
|
3
|
-
def get_uptime
|
4
|
-
uptime = `uptime | tr "," " " | cut -d " " -f5-6`
|
5
|
-
return uptime
|
6
|
-
end
|
7
|
-
|
8
|
-
def get_timezone
|
9
|
-
timezone = `timedatectl | grep -i 'Time zone' | cut -d ':' -f2`
|
10
|
-
return timezone
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
1
|
+
module LinuxUtilinfo
|
2
|
+
module GeneralMethods
|
3
|
+
def get_uptime
|
4
|
+
uptime = `uptime | tr "," " " | cut -d " " -f5-6`
|
5
|
+
return uptime
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_timezone
|
9
|
+
timezone = `timedatectl | grep -i 'Time zone' | cut -d ':' -f2`
|
10
|
+
return timezone
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,29 +1,29 @@
|
|
1
|
-
module LinuxUtilinfo
|
2
|
-
module HardwareMethods
|
3
|
-
def get_processor
|
4
|
-
processor_name = `cat /proc/cpuinfo | grep -m 1 -i 'model name' | cut -d ':' -f2`
|
5
|
-
processor_name.strip!
|
6
|
-
return processor_name
|
7
|
-
end
|
8
|
-
|
9
|
-
def get_bios_vendor
|
10
|
-
bios_vendor = `cat /sys/devices/virtual/dmi/id/bios_vendor`
|
11
|
-
return bios_vendor
|
12
|
-
end
|
13
|
-
|
14
|
-
def get_model
|
15
|
-
product_model = `cat /sys/devices/virtual/dmi/id/product_name`
|
16
|
-
return product_model
|
17
|
-
end
|
18
|
-
|
19
|
-
def get_number_of_cores
|
20
|
-
core_number = `grep -c '^processor' /proc/cpuinfo`
|
21
|
-
return core_number
|
22
|
-
end
|
23
|
-
|
24
|
-
def get_dimensions
|
25
|
-
dimensions = `xdpyinfo | grep 'dimensions:' | cut -d ':' -f2`
|
26
|
-
return dimensions
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
1
|
+
module LinuxUtilinfo
|
2
|
+
module HardwareMethods
|
3
|
+
def get_processor
|
4
|
+
processor_name = `cat /proc/cpuinfo | grep -m 1 -i 'model name' | cut -d ':' -f2`
|
5
|
+
processor_name.strip!
|
6
|
+
return processor_name
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_bios_vendor
|
10
|
+
bios_vendor = `cat /sys/devices/virtual/dmi/id/bios_vendor`
|
11
|
+
return bios_vendor
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_model
|
15
|
+
product_model = `cat /sys/devices/virtual/dmi/id/product_name`
|
16
|
+
return product_model
|
17
|
+
end
|
18
|
+
|
19
|
+
def get_number_of_cores
|
20
|
+
core_number = `grep -c '^processor' /proc/cpuinfo`
|
21
|
+
return core_number
|
22
|
+
end
|
23
|
+
|
24
|
+
def get_dimensions
|
25
|
+
dimensions = `xdpyinfo | grep 'dimensions:' | cut -d ':' -f2`
|
26
|
+
return dimensions
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module LinuxUtilinfo
|
2
|
-
module MemoryMethods
|
3
|
-
def get_total_memory
|
4
|
-
memory_total_in_kb = `cat /proc/meminfo | grep -i 'MemTotal' | awk '{print $2}'`.to_i
|
5
|
-
memory_total_in_kb /= (1000**2)
|
6
|
-
memory_total_in_gb = "#{memory_total_in_kb}GB"
|
7
|
-
return memory_total_in_gb
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
1
|
+
module LinuxUtilinfo
|
2
|
+
module MemoryMethods
|
3
|
+
def get_total_memory
|
4
|
+
memory_total_in_kb = `cat /proc/meminfo | grep -i 'MemTotal' | awk '{print $2}'`.to_i
|
5
|
+
memory_total_in_kb /= (1000**2)
|
6
|
+
memory_total_in_gb = "#{memory_total_in_kb}GB"
|
7
|
+
return memory_total_in_gb
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -1,20 +1,20 @@
|
|
1
|
-
module LinuxUtilinfo
|
2
|
-
module OperatingSystemMethods
|
3
|
-
def get_distro
|
4
|
-
distro_name = `cat /etc/os-release | grep -i '^ID=' | cut -d '=' -f2`
|
5
|
-
distro_name.strip!
|
6
|
-
printf(distro_name)
|
7
|
-
end
|
8
|
-
|
9
|
-
def get_platform
|
10
|
-
platform = `uname`
|
11
|
-
return platform
|
12
|
-
end
|
13
|
-
|
14
|
-
def get_distro_release
|
15
|
-
distro_release = `cat /etc/os-release | grep -i '^VERSION_ID=' | cut -d '=' -f 2`
|
16
|
-
distro_release.gsub!(/^\"|\"?$/, '')
|
17
|
-
return distro_release
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
1
|
+
module LinuxUtilinfo
|
2
|
+
module OperatingSystemMethods
|
3
|
+
def get_distro
|
4
|
+
distro_name = `cat /etc/os-release | grep -i '^ID=' | cut -d '=' -f2`
|
5
|
+
distro_name.strip!
|
6
|
+
printf(distro_name)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_platform
|
10
|
+
platform = `uname`
|
11
|
+
return platform
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_distro_release
|
15
|
+
distro_release = `cat /etc/os-release | grep -i '^VERSION_ID=' | cut -d '=' -f 2`
|
16
|
+
distro_release.gsub!(/^\"|\"?$/, '')
|
17
|
+
return distro_release
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/linux_utilinfo.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require 'linux_utilinfo/hardware_methods'
|
2
|
-
require 'linux_utilinfo/memory_methods'
|
3
|
-
require 'linux_utilinfo/operating_system_methods'
|
4
|
-
require 'linux_utilinfo/environment_methods'
|
5
|
-
|
6
|
-
module LinuxUtilinfo
|
7
|
-
include HardwareMethods
|
8
|
-
include MemoryMethods
|
9
|
-
include OperatingSystemMethods
|
10
|
-
include EnvironmentMethods
|
11
|
-
end
|
1
|
+
require 'linux_utilinfo/hardware_methods'
|
2
|
+
require 'linux_utilinfo/memory_methods'
|
3
|
+
require 'linux_utilinfo/operating_system_methods'
|
4
|
+
require 'linux_utilinfo/environment_methods'
|
5
|
+
|
6
|
+
module LinuxUtilinfo
|
7
|
+
include HardwareMethods
|
8
|
+
include MemoryMethods
|
9
|
+
include OperatingSystemMethods
|
10
|
+
include EnvironmentMethods
|
11
|
+
end
|
data/lib/mac_utilinfo.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
|
-
require "utilinfo/version"
|
2
|
-
|
3
|
-
module MacUtilinfo
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
end
|
1
|
+
require "utilinfo/version"
|
2
|
+
|
3
|
+
module MacUtilinfo
|
4
|
+
def get_total_memory
|
5
|
+
memory_total_in_kb = `cat /proc/meminfo | grep -i 'MemTotal' | awk '{print $2 " " $3}'`
|
6
|
+
return memory_total_in_kb
|
7
|
+
end
|
8
|
+
end
|
data/lib/utilinfo/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module UtilinfoVersion
|
2
|
-
VERSION = "0.1.3"
|
3
|
-
end
|
1
|
+
module UtilinfoVersion
|
2
|
+
VERSION = "0.1.3.1"
|
3
|
+
end
|
data/lib/utilinfo.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
module WinUtilinfo
|
2
|
+
module MemoryMethods
|
3
|
+
def get_total_physical_memory
|
4
|
+
total_physical_memory = `wmic computersystem get totalphysicalmemory | more +1`
|
5
|
+
total_physical_memory.strip!
|
6
|
+
total_physical_memory = total_physical_memory.to_i / (1024 ** 2)
|
7
|
+
total_physical_memory = total_physical_memory.to_s.chars.first(2).join.to_i
|
8
|
+
return "#{total_physical_memory}GB"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/win_utilinfo.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utilinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.3
|
4
|
+
version: 0.1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arun Sahadeo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- lib/utilinfo.rb
|
56
56
|
- lib/utilinfo/version.rb
|
57
57
|
- lib/win_utilinfo.rb
|
58
|
+
- lib/win_utilinfo/memory_methods.rb
|
58
59
|
homepage: https://github.com/ArunSahadeo/utilinfo
|
59
60
|
licenses:
|
60
61
|
- GPL
|
@@ -75,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
76
|
version: '0'
|
76
77
|
requirements: []
|
77
78
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
79
|
+
rubygems_version: 2.5.2
|
79
80
|
signing_key:
|
80
81
|
specification_version: 4
|
81
82
|
summary: Fetch system information from your machine.
|