utilinfo 0.1.3.1 → 0.1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utilinfo/version.rb +1 -1
- data/lib/win_utilinfo.rb +4 -0
- data/lib/win_utilinfo/hardware_methods.rb +42 -0
- data/lib/win_utilinfo/operating_system_methods.rb +33 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85ae1d2893bb3113a1f67e735048de60748e2cba
|
4
|
+
data.tar.gz: 8e6d6f20c105294afecdf5db43460508291f723f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c317aa271f12a4665da8d5648b37651affb178cdead7938ec6528d00c57b8e353718d3fc61689328f13b2a4d630dc8654271b72440176bb53a34e06f725be10d
|
7
|
+
data.tar.gz: 7f056faa61bcb21df7e9610bda69785fda36085c3bfc0ed6cd52c72a139fad7f1359a468bc672a04dca6609fd27d8084c1ac795e858544c17f5e43dd0ef0f1f5
|
data/lib/utilinfo/version.rb
CHANGED
data/lib/win_utilinfo.rb
CHANGED
@@ -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.
|
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
|