sys-uname 1.2.3 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +7 -0
- data/README.md +0 -14
- data/doc/uname.rdoc +3 -35
- data/examples/uname_test.rb +1 -13
- data/lib/sys/platform.rb +1 -8
- data/lib/sys/uname.rb +1 -1
- data/lib/sys/unix/uname.rb +6 -53
- data/lib/sys/windows/uname.rb +1 -1
- data/spec/spec_helper.rb +1 -2
- data/spec/sys_platform_spec.rb +4 -9
- data/spec/sys_uname_spec.rb +61 -111
- data/sys-uname.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8524a066bf960d1b580f589f7e5d3e8a0af333b36fc8c1f8c7a454f6700fc30f
|
4
|
+
data.tar.gz: 4b75dedc44fdd91e5c8b1f5b12ba27726011403e37bd041ddf6e4d4b2d142d8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50b7d3f2f38ff981aed74d147f584f9c24b0f35608fee2af64f3e078cb0998da9c8bee04d7fe71c8f11c24054e5cc754823159265f05e27abd4d52288b61b66d
|
7
|
+
data.tar.gz: 4aa95b911097006bd2f56711da88f0ba10899bd87670c031c3d5cfa3a84388e146e19f53f154553332d112cc5bc71978cf27e397722dcf811d2b39b50bb6d137
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 1.3.1 - 19-Nov-2024
|
2
|
+
* Remove a useless ostruct require. Thanks go to Koichi Ito for the spot and patch.
|
3
|
+
|
4
|
+
## 1.3.0 - 10-Jun-2024
|
5
|
+
* Added DragonflyBSD support.
|
6
|
+
* Removed Solaris support, it's dead.
|
7
|
+
|
1
8
|
## 1.2.3 - 9-Apr-2023
|
2
9
|
* Added rubygems_mfa_required and github_repo to metadata.
|
3
10
|
* Miscellaneous rubocop related updates.
|
data/README.md
CHANGED
@@ -27,20 +27,6 @@ p Sys::Platform.linux? # => true
|
|
27
27
|
p Sys::Platform::ARCH # => :x86_64
|
28
28
|
```
|
29
29
|
|
30
|
-
## Solaris Notes
|
31
|
-
Users on SunOS get several extra methods:
|
32
|
-
|
33
|
-
* architecture
|
34
|
-
* platform
|
35
|
-
* hw_serial
|
36
|
-
* hw_provider
|
37
|
-
* srpc_domain
|
38
|
-
* isa_list
|
39
|
-
* dhcp_cache
|
40
|
-
|
41
|
-
Note that Solaris is essentially a dead OS at this point, so it will not be
|
42
|
-
supported going forward, and will likely be dropped in the next major release.
|
43
|
-
|
44
30
|
## BSD flavors, including OS X
|
45
31
|
Users on BSD platforms get the extra `Uname.model` method.
|
46
32
|
|
data/doc/uname.rdoc
CHANGED
@@ -26,7 +26,7 @@ VERSION
|
|
26
26
|
|
27
27
|
== Class Methods
|
28
28
|
Uname.sysname
|
29
|
-
Returns the operating system name, e.g. "
|
29
|
+
Returns the operating system name, e.g. "Darwin".
|
30
30
|
|
31
31
|
Uname.nodename
|
32
32
|
Returns the nodename. This is usually, but not necessarily, the
|
@@ -48,41 +48,12 @@ Uname.release
|
|
48
48
|
|
49
49
|
Uname.uname
|
50
50
|
Returns a struct of type UnameStruct that contains sysname, nodename,
|
51
|
-
machine, version, and release. On
|
52
|
-
architecture and platform. On HP-UX, it will also include id_number.
|
51
|
+
machine, version, and release. On HP-UX, it will also include id_number.
|
53
52
|
|
54
53
|
MS Windows - there are many more, and different, fields in the struct.
|
55
54
|
Please see the MSDN documenation on the Win32_OperatingSystem WMI class
|
56
55
|
for a complete explanation of what each of these members mean.
|
57
56
|
|
58
|
-
== Solaris Only
|
59
|
-
Uname.architecture
|
60
|
-
Returns the instruction set architecture, e.g. "sparc"
|
61
|
-
|
62
|
-
Uname.platform
|
63
|
-
Returns the platform identifier, e.g. "SUNW,Sun-Blade-100"
|
64
|
-
|
65
|
-
Uname.isa_list
|
66
|
-
Returns a space separated string containing a list of all variant
|
67
|
-
instruction set architectures executable on the current system.
|
68
|
-
|
69
|
-
They are listed in order of performance, from best to worst.
|
70
|
-
|
71
|
-
Uname.hw_provider
|
72
|
-
Returns the name of the hardware manufacturer.
|
73
|
-
|
74
|
-
Uname.hw_serial_number
|
75
|
-
Returns the ASCII representation of the hardware-specific serial number
|
76
|
-
of the machine that executes the function.
|
77
|
-
|
78
|
-
Uname.srpc_domain
|
79
|
-
Returns the name of the Secure Remote Procedure Call domain, if any.
|
80
|
-
|
81
|
-
Uname.dhcp_cache
|
82
|
-
Returns a hexidecimal encoding, in String form, of the name of the
|
83
|
-
interface configured by boot(1M) followed by the DHCPACK reply from
|
84
|
-
the server.
|
85
|
-
|
86
57
|
== BSD Platforms Only (including OS X)
|
87
58
|
Uname.model
|
88
59
|
Returns the model type, e.g. "PowerBook5,1"
|
@@ -105,14 +76,11 @@ UnameStruct members mean.
|
|
105
76
|
None that I'm aware of. Please log any bugs on the project page at
|
106
77
|
https://github.com/djberg96/sys-uname
|
107
78
|
|
108
|
-
== Future Plans
|
109
|
-
Add additional info for Linux, Solaris, BSD.
|
110
|
-
|
111
79
|
== License
|
112
80
|
Apache-2.0
|
113
81
|
|
114
82
|
== Copyright
|
115
|
-
(C) 2002-
|
83
|
+
(C) 2002-2024 Daniel J. Berger
|
116
84
|
All Rights Reserved
|
117
85
|
|
118
86
|
== Warranty
|
data/examples/uname_test.rb
CHANGED
@@ -15,19 +15,7 @@ puts 'Version: ' + Uname.version
|
|
15
15
|
puts 'Release: ' + Uname.release
|
16
16
|
puts 'Machine: ' + Uname.machine # May be "unknown" on Win32
|
17
17
|
|
18
|
-
if RbConfig::CONFIG['host_os'] =~ /
|
19
|
-
print "\nSolaris specific tests\n"
|
20
|
-
puts "==========================="
|
21
|
-
puts 'Architecture: ' + Uname.architecture
|
22
|
-
puts 'Platform: ' + Uname.platform
|
23
|
-
puts 'Instruction Set List: ' + Uname.isa_list.split.join(", ")
|
24
|
-
puts 'Hardware Provider: ' + Uname.hw_provider
|
25
|
-
puts 'Serial Number: ' + Uname.hw_serial_number.to_s
|
26
|
-
puts 'SRPC Domain: ' + Uname.srpc_domain # might be empty
|
27
|
-
puts 'DHCP Cache: ' + Uname.dhcp_cache # might be empty
|
28
|
-
end
|
29
|
-
|
30
|
-
if RbConfig::CONFIG['host_os'] =~ /powerpc|darwin|bsd|mach/i
|
18
|
+
if RbConfig::CONFIG['host_os'] =~ /powerpc|darwin|bsd|dragonfly|mach/i
|
31
19
|
print "\nBSD/OS X specific tests\n"
|
32
20
|
puts "======================="
|
33
21
|
puts 'Model: ' + Uname.model
|
data/lib/sys/platform.rb
CHANGED
@@ -19,9 +19,7 @@ module Sys
|
|
19
19
|
RbConfig::CONFIG['host_os'].split('_').first[/[a-z]+/i].downcase.to_sym
|
20
20
|
when /linux/i
|
21
21
|
:linux
|
22
|
-
when /
|
23
|
-
:solaris
|
24
|
-
when /bsd/i
|
22
|
+
when /bsd|dragonfly/i
|
25
23
|
:bsd
|
26
24
|
end
|
27
25
|
|
@@ -45,11 +43,6 @@ module Sys
|
|
45
43
|
Uname.sysname =~ /linux/i ? true : false
|
46
44
|
end
|
47
45
|
|
48
|
-
# Returns whether or not you're on Solaris
|
49
|
-
def self.solaris?
|
50
|
-
Uname.sysname =~ /sunos|solaris/i ? true : false
|
51
|
-
end
|
52
|
-
|
53
46
|
# Returns whether or not you're on any BSD platform
|
54
47
|
def self.bsd?
|
55
48
|
Uname.sysname =~ /bsd/i ? true : false
|
data/lib/sys/uname.rb
CHANGED
data/lib/sys/unix/uname.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'ffi'
|
4
4
|
require 'rbconfig'
|
5
|
-
require 'ostruct'
|
6
5
|
|
7
6
|
# The Sys module serves as a namespace only.
|
8
7
|
module Sys
|
@@ -20,10 +19,8 @@ module Sys
|
|
20
19
|
case RbConfig::CONFIG['host_os']
|
21
20
|
when /linux/i
|
22
21
|
BUFSIZE = 65
|
23
|
-
when /bsd/i
|
24
|
-
BUFSIZE = 32
|
25
|
-
when /sunos|solaris/i
|
26
|
-
BUFSIZE = 257
|
22
|
+
when /bsd|dragonfly/i
|
23
|
+
BUFSIZE = 32
|
27
24
|
else
|
28
25
|
BUFSIZE = 256
|
29
26
|
end
|
@@ -87,20 +84,7 @@ module Sys
|
|
87
84
|
|
88
85
|
fields.push('domainname') if RbConfig::CONFIG['host_os'] =~ /linux/i
|
89
86
|
fields.push('id_number') if RbConfig::CONFIG['host_os'] =~ /hpux/i
|
90
|
-
|
91
|
-
if RbConfig::CONFIG['host_os'] =~ /sunos|solaris/i
|
92
|
-
fields.push(
|
93
|
-
'architecture',
|
94
|
-
'dhcp_cache',
|
95
|
-
'hw_provider',
|
96
|
-
'hw_serial',
|
97
|
-
'isa_list',
|
98
|
-
'platform',
|
99
|
-
'srpc_domain'
|
100
|
-
)
|
101
|
-
end
|
102
|
-
|
103
|
-
fields.push('model') if RbConfig::CONFIG['host_os'] =~ /darwin|bsd/i
|
87
|
+
fields.push('model') if RbConfig::CONFIG['host_os'] =~ /darwin|bsd|dragonfly/i
|
104
88
|
|
105
89
|
private_constant :UnameFFIStruct
|
106
90
|
|
@@ -111,9 +95,7 @@ module Sys
|
|
111
95
|
# Returns a struct that contains the sysname, nodename, machine, version
|
112
96
|
# and release of your system.
|
113
97
|
#
|
114
|
-
# On OS X it will also include the model.
|
115
|
-
#
|
116
|
-
# On Solaris, it will also include the architecture and platform.
|
98
|
+
# On OS X and BSD platforms it will also include the model.
|
117
99
|
#
|
118
100
|
# On HP-UX, it will also include the id_number.
|
119
101
|
#
|
@@ -135,27 +117,8 @@ module Sys
|
|
135
117
|
struct[:version] = utsname[:version].to_s
|
136
118
|
struct[:machine] = utsname[:machine].to_s
|
137
119
|
|
138
|
-
struct[:model] = get_model() if RbConfig::CONFIG['host_os'] =~ /darwin|bsd/i
|
139
|
-
|
140
|
-
if RbConfig::CONFIG['host_os'] =~ /sunos|solaris/i
|
141
|
-
struct[:architecture] = get_si(SI_ARCHITECTURE)
|
142
|
-
struct[:platform] = get_si(SI_PLATFORM)
|
143
|
-
struct[:hw_serial] = get_si(SI_HW_SERIAL)
|
144
|
-
struct[:hw_provider] = get_si(SI_HW_PROVIDER)
|
145
|
-
struct[:srpc_domain] = get_si(SI_SRPC_DOMAIN)
|
146
|
-
struct[:isa_list] = get_si(SI_ISALIST)
|
147
|
-
struct[:dhcp_cache] = get_si(SI_DHCP_CACHE)
|
148
|
-
|
149
|
-
# FFI and Solaris don't get along so well, so we try again
|
150
|
-
struct[:sysname] = get_si(SI_SYSNAME) if struct.sysname.empty?
|
151
|
-
struct[:nodename] = get_si(SI_HOSTNAME) if struct.nodename.empty?
|
152
|
-
struct[:release] = get_si(SI_RELEASE) if struct.release.empty?
|
153
|
-
struct[:version] = get_si(SI_VERSION) if struct.version.empty?
|
154
|
-
struct[:machine] = get_si(SI_MACHINE) if struct.machine.empty?
|
155
|
-
end
|
156
|
-
|
120
|
+
struct[:model] = get_model() if RbConfig::CONFIG['host_os'] =~ /darwin|bsd|dragonfly/i
|
157
121
|
struct[:id_number] = utsname[:__id_number].to_s if RbConfig::CONFIG['host_os'] =~ /hpux/i
|
158
|
-
|
159
122
|
struct[:domainname] = utsname[:domainname].to_s if RbConfig::CONFIG['host_os'] =~ /linux/i
|
160
123
|
|
161
124
|
# Let's add a members method that works for testing and compatibility
|
@@ -174,7 +137,7 @@ module Sys
|
|
174
137
|
#
|
175
138
|
# Example:
|
176
139
|
#
|
177
|
-
# Uname.sysname # => '
|
140
|
+
# Uname.sysname # => 'Darwin'
|
178
141
|
#
|
179
142
|
def self.sysname
|
180
143
|
uname.sysname
|
@@ -298,15 +261,5 @@ module Sys
|
|
298
261
|
end
|
299
262
|
|
300
263
|
private_class_method :get_model
|
301
|
-
|
302
|
-
# Returns the various sysinfo information based on +flag+.
|
303
|
-
#
|
304
|
-
def self.get_si(flag)
|
305
|
-
buf = 0.chr * BUFSIZE
|
306
|
-
sysinfo(flag, buf, BUFSIZE)
|
307
|
-
buf.strip
|
308
|
-
end
|
309
|
-
|
310
|
-
private_class_method :get_si
|
311
264
|
end
|
312
265
|
end
|
data/lib/sys/windows/uname.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -4,8 +4,7 @@ require 'rspec'
|
|
4
4
|
require 'sys/uname'
|
5
5
|
|
6
6
|
RSpec.configure do |config|
|
7
|
-
config.filter_run_excluding(:
|
8
|
-
config.filter_run_excluding(:bsd) unless RbConfig::CONFIG['host_os'] =~ /powerpc|darwin|macos|bsd/i
|
7
|
+
config.filter_run_excluding(:bsd) unless RbConfig::CONFIG['host_os'] =~ /powerpc|darwin|macos|bsd|dragonfly/i
|
9
8
|
config.filter_run_excluding(:hpux) unless RbConfig::CONFIG['host_os'] =~ /hpux/i
|
10
9
|
config.filter_run_excluding(:linux) unless RbConfig::CONFIG['host_os'] =~ /linux/i
|
11
10
|
config.filter_run_excluding(:windows) unless Gem.win_platform?
|
data/spec/sys_platform_spec.rb
CHANGED
@@ -9,20 +9,20 @@ require 'spec_helper'
|
|
9
9
|
|
10
10
|
RSpec.describe Sys::Platform do
|
11
11
|
example 'the VERSION constant is set to the expected value' do
|
12
|
-
expect(Sys::Platform::VERSION).to eql('1.
|
12
|
+
expect(Sys::Platform::VERSION).to eql('1.3.1')
|
13
13
|
expect(Sys::Platform::VERSION).to be_frozen
|
14
14
|
end
|
15
15
|
|
16
16
|
example 'the ARCH constant is defined' do
|
17
|
-
expect(Sys::Platform::ARCH).to
|
17
|
+
expect(Sys::Platform::ARCH).to be_a(Symbol)
|
18
18
|
end
|
19
19
|
|
20
20
|
example 'the OS constant is defined' do
|
21
|
-
expect(Sys::Platform::OS).to
|
21
|
+
expect(Sys::Platform::OS).to be_a(Symbol)
|
22
22
|
end
|
23
23
|
|
24
24
|
example 'the IMPL constant is defined' do
|
25
|
-
expect(Sys::Platform::IMPL).to
|
25
|
+
expect(Sys::Platform::IMPL).to be_a(Symbol)
|
26
26
|
end
|
27
27
|
|
28
28
|
example 'the IMPL returns an expected value on windows', :windows do
|
@@ -52,11 +52,6 @@ RSpec.describe Sys::Platform do
|
|
52
52
|
expect(described_class.unix?).not_to eql(Gem.win_platform?)
|
53
53
|
end
|
54
54
|
|
55
|
-
example 'the solaris? method is defined and returns a boolean' do
|
56
|
-
expect(described_class).to respond_to(:solaris?)
|
57
|
-
expect(described_class.solaris?).to eql(true).or eql(false)
|
58
|
-
end
|
59
|
-
|
60
55
|
example 'the linux? method is defined and returns a boolean' do
|
61
56
|
expect(described_class).to respond_to(:linux?)
|
62
57
|
expect(described_class.linux?).to eql(true).or eql(false)
|
data/spec/sys_uname_spec.rb
CHANGED
@@ -26,100 +26,55 @@ RSpec.describe Sys::Uname do
|
|
26
26
|
|
27
27
|
context 'universal singleton methods' do
|
28
28
|
example 'version constant is set to expected value' do
|
29
|
-
expect(Sys::Uname::VERSION).to eql('1.
|
29
|
+
expect(Sys::Uname::VERSION).to eql('1.3.1')
|
30
30
|
expect(Sys::Uname::VERSION).to be_frozen
|
31
31
|
end
|
32
32
|
|
33
33
|
example 'uname basic functionality' do
|
34
34
|
expect{ described_class.uname }.not_to raise_error
|
35
|
-
expect(described_class.uname).to
|
35
|
+
expect(described_class.uname).to be_a(Struct)
|
36
36
|
end
|
37
37
|
|
38
38
|
example 'machine singleton method works as expected' do
|
39
39
|
expect(described_class).to respond_to(:machine)
|
40
40
|
expect{ described_class.machine }.not_to raise_error
|
41
|
-
expect(described_class.machine).to
|
41
|
+
expect(described_class.machine).to be_a(String)
|
42
42
|
expect(described_class.machine.size).to be > 0
|
43
43
|
end
|
44
44
|
|
45
45
|
example 'version singleton method works as expected' do
|
46
46
|
expect(described_class).to respond_to(:version)
|
47
47
|
expect{ described_class.version }.not_to raise_error
|
48
|
-
expect(described_class.version).to
|
48
|
+
expect(described_class.version).to be_a(String)
|
49
49
|
expect(described_class.version.size).to be > 0
|
50
50
|
end
|
51
51
|
|
52
52
|
example 'nodename singleton method works as expected' do
|
53
53
|
expect(described_class).to respond_to(:nodename)
|
54
54
|
expect{ described_class.nodename }.not_to raise_error
|
55
|
-
expect(described_class.nodename).to
|
56
|
-
expect(described_class.nodename.size).to be > 0
|
55
|
+
expect(described_class.nodename).to be_a(String)
|
57
56
|
end
|
58
57
|
|
59
58
|
example 'release singleton method works as expected' do
|
60
59
|
expect(described_class).to respond_to(:release)
|
61
60
|
expect{ described_class.release }.not_to raise_error
|
62
|
-
expect(described_class.release).to
|
61
|
+
expect(described_class.release).to be_a(String)
|
63
62
|
expect(described_class.release.size).to be > 0
|
64
63
|
end
|
65
64
|
|
66
65
|
example 'sysname singleton method works as expected' do
|
67
66
|
expect(described_class).to respond_to(:sysname)
|
68
67
|
expect{ described_class.sysname }.not_to raise_error
|
69
|
-
expect(described_class.sysname).to
|
68
|
+
expect(described_class.sysname).to be_a(String)
|
70
69
|
expect(described_class.sysname.size).to be > 0
|
71
70
|
end
|
72
71
|
end
|
73
72
|
|
74
|
-
context 'singleton methods for Solaris only', :solaris do
|
75
|
-
example 'architecture singleton method works as expected on solaris' do
|
76
|
-
expect(described_class).to respond_to(:architecture)
|
77
|
-
expect{ described_class.architecture }.not_to raise_error
|
78
|
-
expect(described_class.architecture).to be_kind_of(String)
|
79
|
-
end
|
80
|
-
|
81
|
-
example 'platform singleton method works as expected on solaris' do
|
82
|
-
expect(described_class).to respond_to(:platform)
|
83
|
-
expect{ described_class.platform }.not_to raise_error
|
84
|
-
expect(described_class.platform).to be_kind_of(String)
|
85
|
-
end
|
86
|
-
|
87
|
-
example 'isa_list singleton method works as expected on solaris' do
|
88
|
-
expect(described_class).to respond_to(:isa_list)
|
89
|
-
expect{ described_class.isa_list }.not_to raise_error
|
90
|
-
expect(described_class.isa_list).to be_kind_of(String)
|
91
|
-
end
|
92
|
-
|
93
|
-
example 'hw_provider singleton method works as expected on solaris' do
|
94
|
-
expect(described_class).to respond_to(:hw_provider)
|
95
|
-
expect{ described_class.hw_provider }.not_to raise_error
|
96
|
-
expect(described_class.hw_provider).to be_kind_of(String)
|
97
|
-
end
|
98
|
-
|
99
|
-
example 'hw_serial singleton method works as expected on solaris' do
|
100
|
-
expect(described_class).to respond_to(:hw_serial)
|
101
|
-
expect{ described_class.hw_serial }.not_to raise_error
|
102
|
-
expect(described_class.hw_serial).to be_kind_of(Integer)
|
103
|
-
end
|
104
|
-
|
105
|
-
example 'srpc_domain singleton method works as expected on solaris' do
|
106
|
-
expect(described_class).to respond_to(:srpc_domain)
|
107
|
-
expect{ described_class.srpc_domain }.not_to raise_error
|
108
|
-
expect(described_class.srpc_domain).to be_kind_of(String)
|
109
|
-
end
|
110
|
-
|
111
|
-
example 'dhcp_cache singleton method works as expected on solaris' do
|
112
|
-
expect(described_class).to respond_to(:dhcp_cache)
|
113
|
-
expect{ described_class.dhcp_cache }.not_to raise_error
|
114
|
-
expect(described_class.dhcp_cache).to be_kind_of(String)
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
73
|
context 'singleton methods for BSD and Darwin only', :bsd do
|
119
74
|
example 'model singleton method works as expected on BSD and Darwin' do
|
120
75
|
expect(described_class).to respond_to(:model)
|
121
76
|
expect{ described_class.model }.not_to raise_error
|
122
|
-
expect(described_class.model).to
|
77
|
+
expect(described_class.model).to be_a(String)
|
123
78
|
end
|
124
79
|
end
|
125
80
|
|
@@ -127,7 +82,7 @@ RSpec.describe Sys::Uname do
|
|
127
82
|
example 'id_number singleton method works as expected on HP-UX' do
|
128
83
|
expect(described_class).to respond_to(:id_number)
|
129
84
|
expect{ described_class.id_number }.not_to raise_error
|
130
|
-
expect(described_class.id_number).to
|
85
|
+
expect(described_class.id_number).to be_a(String)
|
131
86
|
end
|
132
87
|
end
|
133
88
|
|
@@ -137,11 +92,6 @@ RSpec.describe Sys::Uname do
|
|
137
92
|
expect(described_class.uname.members.sort).to eql(members.sort)
|
138
93
|
end
|
139
94
|
|
140
|
-
example 'uname struct contains expected members on solaris', :solaris do
|
141
|
-
members.push(:architecture, :platform, :hw_serial, :hw_provider, :srpc_domain, :isa_list, :dhcp_cache)
|
142
|
-
expect(described_class.uname.members.sort).to eql(members.sort)
|
143
|
-
end
|
144
|
-
|
145
95
|
example 'uname struct contains expected members on bsd or osx', :bsd do
|
146
96
|
members.push(:model)
|
147
97
|
expect(described_class.uname.members.sort).to eql(members.sort)
|
@@ -172,57 +122,57 @@ RSpec.describe Sys::Uname do
|
|
172
122
|
context 'instance methods for MS Windows', :if => File::ALT_SEPARATOR do
|
173
123
|
example 'boot_device' do
|
174
124
|
expect{ described_class.uname.boot_device }.not_to raise_error
|
175
|
-
expect(described_class.uname.boot_device).to
|
125
|
+
expect(described_class.uname.boot_device).to be_a(String)
|
176
126
|
end
|
177
127
|
|
178
128
|
example 'build_number' do
|
179
129
|
expect{ described_class.uname.build_number }.not_to raise_error
|
180
|
-
expect(described_class.uname.build_number).to
|
130
|
+
expect(described_class.uname.build_number).to be_a(String)
|
181
131
|
end
|
182
132
|
|
183
133
|
example 'build_type' do
|
184
134
|
expect{ described_class.uname.build_type }.not_to raise_error
|
185
|
-
expect(described_class.uname.build_type).to
|
135
|
+
expect(described_class.uname.build_type).to be_a(String)
|
186
136
|
end
|
187
137
|
|
188
138
|
example 'caption' do
|
189
139
|
expect{ described_class.uname.caption }.not_to raise_error
|
190
|
-
expect(described_class.uname.caption).to
|
140
|
+
expect(described_class.uname.caption).to be_a(String)
|
191
141
|
end
|
192
142
|
|
193
143
|
example 'code_set' do
|
194
144
|
expect{ described_class.uname.code_set }.not_to raise_error
|
195
|
-
expect(described_class.uname.code_set).to
|
145
|
+
expect(described_class.uname.code_set).to be_a(String)
|
196
146
|
end
|
197
147
|
|
198
148
|
example 'country_code' do
|
199
149
|
expect{ described_class.uname.country_code }.not_to raise_error
|
200
|
-
expect(described_class.uname.country_code).to
|
150
|
+
expect(described_class.uname.country_code).to be_a(String)
|
201
151
|
end
|
202
152
|
|
203
153
|
example 'creation_class_name' do
|
204
154
|
expect{ described_class.uname.creation_class_name }.not_to raise_error
|
205
|
-
expect(described_class.uname.creation_class_name).to
|
155
|
+
expect(described_class.uname.creation_class_name).to be_a(String)
|
206
156
|
end
|
207
157
|
|
208
158
|
example 'cscreation_class_name' do
|
209
159
|
expect{ described_class.uname.cscreation_class_name }.not_to raise_error
|
210
|
-
expect(described_class.uname.cscreation_class_name).to
|
160
|
+
expect(described_class.uname.cscreation_class_name).to be_a(String)
|
211
161
|
end
|
212
162
|
|
213
163
|
example 'csd_version' do
|
214
164
|
expect{ described_class.uname.csd_version }.not_to raise_error
|
215
|
-
expect(described_class.uname.csd_version).to
|
165
|
+
expect(described_class.uname.csd_version).to be_a(String).or be_nil
|
216
166
|
end
|
217
167
|
|
218
168
|
example 'cs_name' do
|
219
169
|
expect{ described_class.uname.cs_name }.not_to raise_error
|
220
|
-
expect(described_class.uname.cs_name).to
|
170
|
+
expect(described_class.uname.cs_name).to be_a(String)
|
221
171
|
end
|
222
172
|
|
223
173
|
example 'current_time_zone' do
|
224
174
|
expect{ described_class.uname.current_time_zone }.not_to raise_error
|
225
|
-
expect(described_class.uname.current_time_zone).to
|
175
|
+
expect(described_class.uname.current_time_zone).to be_a(Integer)
|
226
176
|
end
|
227
177
|
|
228
178
|
example 'debug' do
|
@@ -232,7 +182,7 @@ RSpec.describe Sys::Uname do
|
|
232
182
|
|
233
183
|
example 'description' do
|
234
184
|
expect{ described_class.uname.description }.not_to raise_error
|
235
|
-
expect(described_class.uname.description).to
|
185
|
+
expect(described_class.uname.description).to be_a(String)
|
236
186
|
end
|
237
187
|
|
238
188
|
example 'distributed' do
|
@@ -242,117 +192,117 @@ RSpec.describe Sys::Uname do
|
|
242
192
|
|
243
193
|
example 'encryption_level' do
|
244
194
|
expect{ described_class.uname.encryption_level }.not_to raise_error
|
245
|
-
expect(described_class.uname.encryption_level).to
|
195
|
+
expect(described_class.uname.encryption_level).to be_a(Integer)
|
246
196
|
end
|
247
197
|
|
248
198
|
example 'foreground_application_boost' do
|
249
199
|
expect{ described_class.uname.foreground_application_boost }.not_to raise_error
|
250
|
-
expect(described_class.uname.foreground_application_boost).to
|
200
|
+
expect(described_class.uname.foreground_application_boost).to be_a(Integer)
|
251
201
|
end
|
252
202
|
|
253
203
|
example 'free_physical_memory' do
|
254
204
|
expect{ described_class.uname.free_physical_memory }.not_to raise_error
|
255
|
-
expect(described_class.uname.free_physical_memory).to
|
205
|
+
expect(described_class.uname.free_physical_memory).to be_a(Integer)
|
256
206
|
end
|
257
207
|
|
258
208
|
example 'free_space_in_paging_files' do
|
259
209
|
expect{ described_class.uname.free_space_in_paging_files }.not_to raise_error
|
260
|
-
expect(described_class.uname.free_space_in_paging_files).to
|
210
|
+
expect(described_class.uname.free_space_in_paging_files).to be_a(Integer)
|
261
211
|
end
|
262
212
|
|
263
213
|
example 'free_virtual_memory' do
|
264
214
|
expect{ described_class.uname.free_virtual_memory }.not_to raise_error
|
265
|
-
expect(described_class.uname.free_virtual_memory).to
|
215
|
+
expect(described_class.uname.free_virtual_memory).to be_a(Integer)
|
266
216
|
end
|
267
217
|
|
268
218
|
example 'install_date' do
|
269
219
|
expect{ described_class.uname.install_date }.not_to raise_error
|
270
|
-
expect(described_class.uname.install_date).to
|
220
|
+
expect(described_class.uname.install_date).to be_a(Time)
|
271
221
|
end
|
272
222
|
|
273
223
|
example 'last_bootup_time' do
|
274
224
|
expect{ described_class.uname.last_bootup_time }.not_to raise_error
|
275
|
-
expect(described_class.uname.last_bootup_time).to
|
225
|
+
expect(described_class.uname.last_bootup_time).to be_a(Time)
|
276
226
|
end
|
277
227
|
|
278
228
|
example 'local_date_time' do
|
279
229
|
expect{ described_class.uname.local_date_time }.not_to raise_error
|
280
|
-
expect(described_class.uname.local_date_time).to
|
230
|
+
expect(described_class.uname.local_date_time).to be_a(Time)
|
281
231
|
end
|
282
232
|
|
283
233
|
example 'locale' do
|
284
234
|
expect{ described_class.uname.locale }.not_to raise_error
|
285
|
-
expect(described_class.uname.locale).to
|
235
|
+
expect(described_class.uname.locale).to be_a(String)
|
286
236
|
end
|
287
237
|
|
288
238
|
example 'manufacturer' do
|
289
239
|
expect{ described_class.uname.manufacturer }.not_to raise_error
|
290
|
-
expect(described_class.uname.manufacturer).to
|
240
|
+
expect(described_class.uname.manufacturer).to be_a(String)
|
291
241
|
end
|
292
242
|
|
293
243
|
example 'max_number_of_processes' do
|
294
244
|
expect{ described_class.uname.max_number_of_processes }.not_to raise_error
|
295
|
-
expect(described_class.uname.max_number_of_processes).to
|
245
|
+
expect(described_class.uname.max_number_of_processes).to be_a(Integer)
|
296
246
|
end
|
297
247
|
|
298
248
|
example 'max_process_memory_size' do
|
299
249
|
expect{ described_class.uname.max_process_memory_size }.not_to raise_error
|
300
|
-
expect(described_class.uname.max_process_memory_size).to
|
250
|
+
expect(described_class.uname.max_process_memory_size).to be_a(Integer)
|
301
251
|
end
|
302
252
|
|
303
253
|
example 'name' do
|
304
254
|
expect{ described_class.uname.name }.not_to raise_error
|
305
|
-
expect(described_class.uname.name).to
|
255
|
+
expect(described_class.uname.name).to be_a(String)
|
306
256
|
end
|
307
257
|
|
308
258
|
example 'number_of_licensed_users' do
|
309
259
|
expect{ described_class.uname.number_of_licensed_users }.not_to raise_error
|
310
|
-
expect(described_class.uname.number_of_licensed_users).to
|
260
|
+
expect(described_class.uname.number_of_licensed_users).to be_a(Integer).or be_nil
|
311
261
|
end
|
312
262
|
|
313
263
|
example 'number_of_processes' do
|
314
264
|
expect{ described_class.uname.number_of_processes }.not_to raise_error
|
315
|
-
expect(described_class.uname.number_of_processes).to
|
265
|
+
expect(described_class.uname.number_of_processes).to be_a(Integer)
|
316
266
|
end
|
317
267
|
|
318
268
|
example 'number_of_users' do
|
319
269
|
expect{ described_class.uname.number_of_users }.not_to raise_error
|
320
|
-
expect(described_class.uname.number_of_users).to
|
270
|
+
expect(described_class.uname.number_of_users).to be_a(Integer)
|
321
271
|
end
|
322
272
|
|
323
273
|
example 'organization', :unless => ENV['CI'] do
|
324
274
|
expect{ described_class.uname.organization }.not_to raise_error
|
325
|
-
expect(described_class.uname.organization).to
|
275
|
+
expect(described_class.uname.organization).to be_a(String)
|
326
276
|
end
|
327
277
|
|
328
278
|
example 'os_language' do
|
329
279
|
expect{ described_class.uname.os_language }.not_to raise_error
|
330
|
-
expect(described_class.uname.os_language).to
|
280
|
+
expect(described_class.uname.os_language).to be_a(Integer)
|
331
281
|
end
|
332
282
|
|
333
283
|
example 'os_product_suite' do
|
334
284
|
expect{ described_class.uname.os_product_suite }.not_to raise_error
|
335
|
-
expect(described_class.uname.os_product_suite).to
|
285
|
+
expect(described_class.uname.os_product_suite).to be_a(Integer)
|
336
286
|
end
|
337
287
|
|
338
288
|
example 'os_type' do
|
339
289
|
expect{ described_class.uname.os_type }.not_to raise_error
|
340
|
-
expect(described_class.uname.os_type).to
|
290
|
+
expect(described_class.uname.os_type).to be_a(Integer)
|
341
291
|
end
|
342
292
|
|
343
293
|
example 'other_type_description' do
|
344
294
|
expect{ described_class.uname.other_type_description }.not_to raise_error
|
345
|
-
expect(described_class.uname.other_type_description).to
|
295
|
+
expect(described_class.uname.other_type_description).to be_a(String).or be_nil
|
346
296
|
end
|
347
297
|
|
348
298
|
example 'plus_product_id' do
|
349
299
|
expect{ described_class.uname.plus_product_id }.not_to raise_error
|
350
|
-
expect(described_class.uname.plus_product_id).to
|
300
|
+
expect(described_class.uname.plus_product_id).to be_a(Integer).or be_nil
|
351
301
|
end
|
352
302
|
|
353
303
|
example 'plus_version_number' do
|
354
304
|
expect{ described_class.uname.plus_version_number }.not_to raise_error
|
355
|
-
expect(described_class.uname.plus_version_number).to
|
305
|
+
expect(described_class.uname.plus_version_number).to be_a(Integer).or be_nil
|
356
306
|
end
|
357
307
|
|
358
308
|
example 'primary' do
|
@@ -362,88 +312,88 @@ RSpec.describe Sys::Uname do
|
|
362
312
|
|
363
313
|
example 'product_type' do
|
364
314
|
expect{ described_class.uname.product_type }.not_to raise_error
|
365
|
-
expect(described_class.uname.product_type).to
|
315
|
+
expect(described_class.uname.product_type).to be_a(Integer)
|
366
316
|
end
|
367
317
|
|
368
318
|
example 'quantum_length' do
|
369
319
|
expect{ described_class.uname.quantum_length }.not_to raise_error
|
370
|
-
expect(described_class.uname.quantum_length).to
|
320
|
+
expect(described_class.uname.quantum_length).to be_a(Integer).or be_nil
|
371
321
|
end
|
372
322
|
|
373
323
|
example 'quantum_type' do
|
374
324
|
expect{ described_class.uname.quantum_type }.not_to raise_error
|
375
|
-
expect(described_class.uname.quantum_type).to
|
325
|
+
expect(described_class.uname.quantum_type).to be_a(Integer).or be_nil
|
376
326
|
end
|
377
327
|
|
378
328
|
example 'registered_user', :unless => ENV['CI'] do
|
379
329
|
expect{ described_class.uname.registered_user }.not_to raise_error
|
380
|
-
expect(described_class.uname.registered_user).to
|
330
|
+
expect(described_class.uname.registered_user).to be_a(String)
|
381
331
|
end
|
382
332
|
|
383
333
|
example 'serial_number' do
|
384
334
|
expect{ described_class.uname.serial_number }.not_to raise_error
|
385
|
-
expect(described_class.uname.serial_number).to
|
335
|
+
expect(described_class.uname.serial_number).to be_a(String)
|
386
336
|
end
|
387
337
|
|
388
338
|
example 'service_pack_major_version' do
|
389
339
|
expect{ described_class.uname.service_pack_major_version }.not_to raise_error
|
390
|
-
expect(described_class.uname.service_pack_major_version).to
|
340
|
+
expect(described_class.uname.service_pack_major_version).to be_a(Integer)
|
391
341
|
end
|
392
342
|
|
393
343
|
example 'service_pack_minor_version' do
|
394
344
|
expect{ described_class.uname.service_pack_minor_version }.not_to raise_error
|
395
|
-
expect(described_class.uname.service_pack_minor_version).to
|
345
|
+
expect(described_class.uname.service_pack_minor_version).to be_a(Integer)
|
396
346
|
end
|
397
347
|
|
398
348
|
example 'status' do
|
399
349
|
expect{ described_class.uname.status }.not_to raise_error
|
400
|
-
expect(described_class.uname.status).to
|
350
|
+
expect(described_class.uname.status).to be_a(String)
|
401
351
|
end
|
402
352
|
|
403
353
|
example 'suite_mask' do
|
404
354
|
expect{ described_class.uname.suite_mask }.not_to raise_error
|
405
|
-
expect(described_class.uname.suite_mask).to
|
355
|
+
expect(described_class.uname.suite_mask).to be_a(Integer)
|
406
356
|
end
|
407
357
|
|
408
358
|
example 'system_device' do
|
409
359
|
expect{ described_class.uname.system_device }.not_to raise_error
|
410
|
-
expect(described_class.uname.system_device).to
|
360
|
+
expect(described_class.uname.system_device).to be_a(String)
|
411
361
|
end
|
412
362
|
|
413
363
|
example 'system_directory' do
|
414
364
|
expect{ described_class.uname.system_directory }.not_to raise_error
|
415
|
-
expect(described_class.uname.system_directory).to
|
365
|
+
expect(described_class.uname.system_directory).to be_a(String)
|
416
366
|
end
|
417
367
|
|
418
368
|
example 'system_drive' do
|
419
369
|
expect{ described_class.uname.system_drive }.not_to raise_error
|
420
|
-
expect(described_class.uname.system_drive).to
|
370
|
+
expect(described_class.uname.system_drive).to be_a(String)
|
421
371
|
expect(described_class.uname.system_drive).to eql('C:')
|
422
372
|
end
|
423
373
|
|
424
374
|
example 'total_swap_space_size' do
|
425
375
|
expect{ described_class.uname.total_swap_space_size }.not_to raise_error
|
426
|
-
expect(described_class.uname.total_swap_space_size).to
|
376
|
+
expect(described_class.uname.total_swap_space_size).to be_a(Integer).or be_nil
|
427
377
|
end
|
428
378
|
|
429
379
|
example 'total_virtual_memory_size' do
|
430
380
|
expect{ described_class.uname.total_virtual_memory_size }.not_to raise_error
|
431
|
-
expect(described_class.uname.total_virtual_memory_size).to
|
381
|
+
expect(described_class.uname.total_virtual_memory_size).to be_a(Integer)
|
432
382
|
end
|
433
383
|
|
434
384
|
example 'total_visible_memory_size' do
|
435
385
|
expect{ described_class.uname.total_visible_memory_size }.not_to raise_error
|
436
|
-
expect(described_class.uname.total_visible_memory_size).to
|
386
|
+
expect(described_class.uname.total_visible_memory_size).to be_a(Integer)
|
437
387
|
end
|
438
388
|
|
439
389
|
example 'version' do
|
440
390
|
expect{ described_class.uname.version }.not_to raise_error
|
441
|
-
expect(described_class.uname.version).to
|
391
|
+
expect(described_class.uname.version).to be_a(String)
|
442
392
|
end
|
443
393
|
|
444
394
|
example 'windows_directory' do
|
445
395
|
expect{ described_class.uname.windows_directory }.not_to raise_error
|
446
|
-
expect(described_class.uname.windows_directory).to
|
396
|
+
expect(described_class.uname.windows_directory).to be_a(String)
|
447
397
|
end
|
448
398
|
end
|
449
399
|
end
|
data/sys-uname.gemspec
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-uname
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
36
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2024-11-19 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: ffi
|
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '0'
|
166
166
|
requirements: []
|
167
|
-
rubygems_version: 3.
|
167
|
+
rubygems_version: 3.5.16
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: An interface for returning uname (platform) information
|
metadata.gz.sig
CHANGED
Binary file
|