utilinfo 0.1.3.1 → 0.1.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5ea69cdb16b3e61b7337907219e0c400bbae1e6
4
- data.tar.gz: af8570bc9569efa184530865c06cf5076d631338
3
+ metadata.gz: 85ae1d2893bb3113a1f67e735048de60748e2cba
4
+ data.tar.gz: 8e6d6f20c105294afecdf5db43460508291f723f
5
5
  SHA512:
6
- metadata.gz: ec047e63be45dfe6c687bd8ef26e0419c9f6348e0e7f39677c1bfd2b67a00b36eebac561d96d6c7e4cba0bdbbb55713a35e5d14de40ec782af08cdb32eba5e47
7
- data.tar.gz: ae3f081d5b4b7e8535111f2163ce9d77d40e319443383b00e668df6cb0cda9f5cff6b83ff3bf72e84b795598f87b042859e38b6a575c08bb731d9b84c7762661
6
+ metadata.gz: c317aa271f12a4665da8d5648b37651affb178cdead7938ec6528d00c57b8e353718d3fc61689328f13b2a4d630dc8654271b72440176bb53a34e06f725be10d
7
+ data.tar.gz: 7f056faa61bcb21df7e9610bda69785fda36085c3bfc0ed6cd52c72a139fad7f1359a468bc672a04dca6609fd27d8084c1ac795e858544c17f5e43dd0ef0f1f5
@@ -1,3 +1,3 @@
1
1
  module UtilinfoVersion
2
- VERSION = "0.1.3.1"
2
+ VERSION = "0.1.3.2"
3
3
  end
data/lib/win_utilinfo.rb CHANGED
@@ -1,5 +1,9 @@
1
+ require 'win_utilinfo/hardware_methods'
1
2
  require 'win_utilinfo/memory_methods'
3
+ require 'win_utilinfo/operating_system_methods'
2
4
 
3
5
  module WinUtilinfo
6
+ include HardwareMethods
4
7
  include MemoryMethods
8
+ include OperatingSystemMethods
5
9
  end
@@ -0,0 +1,42 @@
1
+ module WinUtilinfo
2
+ module HardwareMethods
3
+
4
+ def get_manufacturer
5
+ manufacturer = `wmic computersystem get Manufacturer | more +1`.strip!
6
+ return manufacturer
7
+ end
8
+
9
+ def get_model
10
+ model = `wmic computersystem get Model | more +1`.strip!
11
+ return model
12
+ end
13
+
14
+ def get_processor_count
15
+ processor_count = `wmic computersystem get NumberofProcessors | more +1`.strip!
16
+ return processor_count
17
+ end
18
+
19
+ def get_dimensions
20
+ screen_width = `wmic desktopmonitor get screenwidth | more +1`.strip!
21
+ screen_height = `wmic desktopmonitor get screenheight | more +1`.strip!
22
+ screen_dimensions = []
23
+
24
+ if screen_width.count("\n") > 1 && screen_height.count("\n") > 1
25
+ screen_widths = screen_width.split("\n")
26
+ screen_heights = screen_height.split("\n")
27
+ screen_widths.each_with_index do |screen_w, index|
28
+ if screen_w.strip.length < 1
29
+ next
30
+ end
31
+ screen_w.strip!
32
+ dimensions = "#{screen_w}x#{screen_heights[index]}"
33
+ screen_dimensions.concat([dimensions])
34
+ end
35
+ else
36
+ screen_dimensions = "#{screen_width}x#{screen_height}"
37
+ end
38
+
39
+ return screen_dimensions
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,33 @@
1
+ module WinUtilinfo
2
+ module OperatingSystemMethods
3
+ def get_os_name
4
+ os_name = `wmic os get caption | more +1`
5
+ os_name.strip!
6
+ return os_name
7
+ end
8
+
9
+ def get_build_number
10
+ build_number = `wmic os get BuildNumber | more +1`
11
+ build_number.strip!
12
+ return build_number
13
+ end
14
+
15
+ def get_original_install_date
16
+ install_date = `powershell -c "gcim Win32_OperatingSystem | select InstallDate -ExpandProperty InstallDate"`
17
+ install_date.strip!
18
+ return install_date
19
+ end
20
+
21
+ def get_os_architecture
22
+ os_architecture = `wmic os get OSArchitecture | more +1`
23
+ os_architecture.strip!
24
+ return os_architecture
25
+ end
26
+
27
+ def is_licenced
28
+ licence_status = `wmic PATH SoftwareLicensingProduct WHERE "ProductKeyID like '%-%' AND Description like '%Windows%'" get LicenseStatus | more +1`
29
+ return licence_status
30
+ end
31
+
32
+ end
33
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utilinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.1
4
+ version: 0.1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arun Sahadeo
@@ -55,7 +55,9 @@ files:
55
55
  - lib/utilinfo.rb
56
56
  - lib/utilinfo/version.rb
57
57
  - lib/win_utilinfo.rb
58
+ - lib/win_utilinfo/hardware_methods.rb
58
59
  - lib/win_utilinfo/memory_methods.rb
60
+ - lib/win_utilinfo/operating_system_methods.rb
59
61
  homepage: https://github.com/ArunSahadeo/utilinfo
60
62
  licenses:
61
63
  - GPL