sys-uname 1.2.3 → 1.3.0

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
  SHA256:
3
- metadata.gz: da53561b44caf45c227aad7130b9b120e9bbdd3cd35b665ecf527b8a7ad51996
4
- data.tar.gz: ce041695020d00b6eeacb5861fc39268a84a6bc4f586f3c2576f2b4e599816d7
3
+ metadata.gz: 19e018e416bcea0fd03d4d34554d8ac3f904d7a9c71461966925e5b3d5919cd4
4
+ data.tar.gz: fc9c7883ee6f7a4f17b129c132fa20b1c3ada2b68cb78dbecc2e16687007c93b
5
5
  SHA512:
6
- metadata.gz: dd826360df12898bb135c2a442c475cbf209c1dae207b290214af3ae8130eaaed41800c2744942908ac11469c4ec9c7d2bebbd25bf112041148c629b502431d3
7
- data.tar.gz: bd9cdeff9d5459e7c66e86b280c6f19f046812bfdb3abb05b8c874cfd535df3895f8ad3198026df3ac2f845690bc85dd0b9ab939212b6563c95071215e011453
6
+ metadata.gz: 516fc8b3658b538eed4a81b28756af79b8d6aadf718d03a4e995b5a2d44c7dcada9b123a19206a4c91da126faed8e3f93d5c8dbdec16fc6afa72aa94240819b4
7
+ data.tar.gz: 9978cc8d5929f4167314ea05c873a05e357008812df1480b8f59a24a8ebddf5c6568a7618a7db83437e02914f3008fc2890c2b9fdfe1b2a1ef04cd4c34c5f6e0
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.3.0 - 10-Jun-2024
2
+ * Added DragonflyBSD support.
3
+ * Removed Solaris support, it's dead.
4
+
1
5
  ## 1.2.3 - 9-Apr-2023
2
6
  * Added rubygems_mfa_required and github_repo to metadata.
3
7
  * 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. "SunOS"
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 Solaris, it will also include
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-2023 Daniel J. Berger
83
+ (C) 2002-2024 Daniel J. Berger
116
84
  All Rights Reserved
117
85
 
118
86
  == Warranty
@@ -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'] =~ /sun|solaris/i
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 /sunos|solaris/i
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
@@ -3,7 +3,7 @@
3
3
  module Sys
4
4
  class Uname
5
5
  # The version of the sys-uname gem.
6
- VERSION = '1.2.3'
6
+ VERSION = '1.3.0'
7
7
  end
8
8
 
9
9
  class Platform
@@ -20,10 +20,8 @@ module Sys
20
20
  case RbConfig::CONFIG['host_os']
21
21
  when /linux/i
22
22
  BUFSIZE = 65
23
- when /bsd/i
24
- BUFSIZE = 32 # TODO: version method chopped
25
- when /sunos|solaris/i
26
- BUFSIZE = 257
23
+ when /bsd|dragonfly/i
24
+ BUFSIZE = 32
27
25
  else
28
26
  BUFSIZE = 256
29
27
  end
@@ -87,20 +85,7 @@ module Sys
87
85
 
88
86
  fields.push('domainname') if RbConfig::CONFIG['host_os'] =~ /linux/i
89
87
  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
88
+ fields.push('model') if RbConfig::CONFIG['host_os'] =~ /darwin|bsd|dragonfly/i
104
89
 
105
90
  private_constant :UnameFFIStruct
106
91
 
@@ -111,9 +96,7 @@ module Sys
111
96
  # Returns a struct that contains the sysname, nodename, machine, version
112
97
  # and release of your system.
113
98
  #
114
- # On OS X it will also include the model.
115
- #
116
- # On Solaris, it will also include the architecture and platform.
99
+ # On OS X and BSD platforms it will also include the model.
117
100
  #
118
101
  # On HP-UX, it will also include the id_number.
119
102
  #
@@ -135,27 +118,8 @@ module Sys
135
118
  struct[:version] = utsname[:version].to_s
136
119
  struct[:machine] = utsname[:machine].to_s
137
120
 
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
-
121
+ struct[:model] = get_model() if RbConfig::CONFIG['host_os'] =~ /darwin|bsd|dragonfly/i
157
122
  struct[:id_number] = utsname[:__id_number].to_s if RbConfig::CONFIG['host_os'] =~ /hpux/i
158
-
159
123
  struct[:domainname] = utsname[:domainname].to_s if RbConfig::CONFIG['host_os'] =~ /linux/i
160
124
 
161
125
  # Let's add a members method that works for testing and compatibility
@@ -174,7 +138,7 @@ module Sys
174
138
  #
175
139
  # Example:
176
140
  #
177
- # Uname.sysname # => 'SunOS'
141
+ # Uname.sysname # => 'Darwin'
178
142
  #
179
143
  def self.sysname
180
144
  uname.sysname
@@ -298,15 +262,5 @@ module Sys
298
262
  end
299
263
 
300
264
  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
265
  end
312
266
  end
@@ -490,7 +490,7 @@ module Sys
490
490
  # String rather than a Fixnum/Bignum. This deals with that for now.
491
491
  #
492
492
  def self.convert(str)
493
- return nil if str.nil? # Don't turn nil into 0
493
+ return nil if str.nil? # Don't turn nil into 0
494
494
  str.to_i
495
495
  end
496
496
 
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(:solaris) unless RbConfig::CONFIG['host_os'] =~ /sunos|solaris/i
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?
@@ -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.2.3')
12
+ expect(Sys::Platform::VERSION).to eql('1.3.0')
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 be_kind_of(Symbol)
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 be_kind_of(Symbol)
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 be_kind_of(Symbol)
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)
@@ -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.2.3')
29
+ expect(Sys::Uname::VERSION).to eql('1.3.0')
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 be_kind_of(Struct)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String).or be_nil
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 be_kind_of(String)
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 be_kind_of(Integer)
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 be_kind_of(String)
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 be_kind_of(Integer)
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 be_kind_of(Integer)
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 be_kind_of(Integer)
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 be_kind_of(Integer)
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 be_kind_of(Integer)
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 be_kind_of(Time)
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 be_kind_of(Time)
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 be_kind_of(Time)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(Integer)
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 be_kind_of(Integer)
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 be_kind_of(String)
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 be_kind_of(Integer).or be_nil
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 be_kind_of(Integer)
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 be_kind_of(Integer)
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 be_kind_of(String)
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 be_kind_of(Integer)
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 be_kind_of(Integer)
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 be_kind_of(Integer)
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 be_kind_of(String).or be_nil
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 be_kind_of(Integer).or be_nil
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 be_kind_of(Integer).or be_nil
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 be_kind_of(Integer)
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 be_kind_of(Integer).or be_nil
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 be_kind_of(Integer).or be_nil
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(Integer)
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 be_kind_of(Integer)
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 be_kind_of(String)
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 be_kind_of(Integer)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(String)
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 be_kind_of(Integer).or be_nil
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 be_kind_of(Integer)
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 be_kind_of(Integer)
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 be_kind_of(String)
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 be_kind_of(String)
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
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'sys-uname'
5
- spec.version = '1.2.3'
5
+ spec.version = '1.3.0'
6
6
  spec.author = 'Daniel J. Berger'
7
7
  spec.email = 'djberg96@gmail.com'
8
8
  spec.homepage = 'http://github.com/djberg96/sys-uname'
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.2.3
4
+ version: 1.3.0
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: 2023-04-09 00:00:00.000000000 Z
38
+ date: 2024-06-10 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ffi
metadata.gz.sig CHANGED
Binary file