utilinfo 0.1.3 → 0.1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf389f86e666ed91bb12cad3dbdad16300440976
4
- data.tar.gz: fddf4490986e354fac5b626a257c450de6b11f86
3
+ metadata.gz: a5ea69cdb16b3e61b7337907219e0c400bbae1e6
4
+ data.tar.gz: af8570bc9569efa184530865c06cf5076d631338
5
5
  SHA512:
6
- metadata.gz: a2667d5873f88453337b50b1601adc9b7e095c05eac961e9841c7d8d854d3a6a3078f601cfe668b704682438e22a31af1792df218e36eb5c6fdef3ea8328117e
7
- data.tar.gz: d6f945c971d99498bf6c56058e30a2f2f45483a7bad09ceb8566fd697d77e5132654e8e33313c4bd07684c80c31a61c3b60ea45e3dd4c4efdd78cc408dd42c37
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
@@ -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
- class Utilinfo
5
- def get_total_memory
6
- memory_total_in_kb = `cat /proc/meminfo | grep -i 'MemTotal' | awk '{print $2 " " $3}'`
7
- return memory_total_in_kb
8
- end
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
@@ -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
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "linux_utilinfo"
4
+ require "win_utilinfo"
5
+ require "mac_utilinfo"
4
6
  require "utilinfo/version"
5
7
 
6
8
  class Utilinfo
@@ -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
@@ -1,9 +1,5 @@
1
- require "utilinfo/version"
1
+ require 'win_utilinfo/memory_methods'
2
2
 
3
3
  module WinUtilinfo
4
- class Utilinfo
5
- def get_total_memory
6
- puts "test"
7
- end
8
- end
4
+ include MemoryMethods
9
5
  end
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-07 00:00:00.000000000 Z
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.6.11
79
+ rubygems_version: 2.5.2
79
80
  signing_key:
80
81
  specification_version: 4
81
82
  summary: Fetch system information from your machine.