sys-uname 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +4 -0
- data/Rakefile +18 -42
- data/ext/sys/uname.c +2 -2
- data/sys-uname.gemspec +1 -1
- data/test/test_sys_uname.rb +408 -408
- metadata +27 -9
data/CHANGES
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
== 0.8.5 - 11-Dec-2010
|
2
|
+
* Removed some non-ascii characters that somehow made it into the source.
|
3
|
+
* Some updates to the Rakefile, including a default task.
|
4
|
+
|
1
5
|
== 0.8.4 - 29-Jan-2010
|
2
6
|
* Bug fix for Windows 7, which appears to have removed the QuantumLength and
|
3
7
|
QuantumType members of the Win32_OperatingSystem class. Thanks go to Mark
|
data/Rakefile
CHANGED
@@ -4,58 +4,32 @@ require 'rake/testtask'
|
|
4
4
|
require 'rbconfig'
|
5
5
|
include Config
|
6
6
|
|
7
|
-
|
8
|
-
task :clean do
|
9
|
-
Dir.chdir('ext') do
|
10
|
-
unless CONFIG['host_os'] =~ /mswin|windows|mingw|cygwin|dos/i
|
11
|
-
build_file = 'uname.' + Config::CONFIG['DLEXT']
|
12
|
-
rm "sys/#{build_file}" if File.exists?("sys/#{build_file}")
|
13
|
-
sh 'make distclean' if File.exists?(build_file)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
7
|
+
WINDOWS = CONFIG['host_os'] =~ /msdos|mswin|win32|windows|mingw|cygwin/i
|
17
8
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
28
|
-
end
|
9
|
+
CLEAN.include(
|
10
|
+
'**/*.gem', # Gem files
|
11
|
+
'**/*.rbc', # Rubinius
|
12
|
+
'**/*.o', # C object file
|
13
|
+
'**/*.log', # Ruby extension build log
|
14
|
+
'**/Makefile', # C Makefile
|
15
|
+
'**/conftest.dSYM', # OS X build directory
|
16
|
+
"**/*.#{CONFIG['DLEXT']}" # C shared object
|
17
|
+
)
|
29
18
|
|
30
19
|
desc "Run the example program"
|
31
20
|
task :example => [:build] do
|
32
|
-
if
|
21
|
+
if WINDOWS
|
33
22
|
sh 'ruby -Ilib examples/uname_test.rb'
|
34
23
|
else
|
35
24
|
sh 'ruby -Iext examples/uname_test.rb'
|
36
25
|
end
|
37
26
|
end
|
38
27
|
|
39
|
-
namespace 'sys' do
|
40
|
-
desc "Install the sys-uname library (system)"
|
41
|
-
task :install do
|
42
|
-
if CONFIG['host_os'] =~ /mswin|windows|mingw|cygwin|dos/i
|
43
|
-
dir = File.join(CONFIG['sitelibdir'], 'sys')
|
44
|
-
Dir.mkdir(dir) unless File.exists?(dir)
|
45
|
-
FileUtils.cp('lib/sys/uname.rb', dir, :verbose => true)
|
46
|
-
else
|
47
|
-
Dir.chdir('ext') do
|
48
|
-
sh 'make install'
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
28
|
namespace 'gem' do
|
55
|
-
desc "
|
56
|
-
task :
|
29
|
+
desc "Create the sys-uname gem"
|
30
|
+
task :create do
|
57
31
|
spec = eval(IO.read('sys-uname.gemspec'))
|
58
|
-
if
|
32
|
+
if WINDOWS
|
59
33
|
spec.files = spec.files.reject{ |f| f.include?('ext') }
|
60
34
|
spec.platform = Gem::Platform::CURRENT
|
61
35
|
else
|
@@ -67,7 +41,7 @@ namespace 'gem' do
|
|
67
41
|
end
|
68
42
|
|
69
43
|
desc "Install the sys-uname gem"
|
70
|
-
task :install => [:
|
44
|
+
task :install => [:create] do
|
71
45
|
file = Dir['sys-uname*.gem'].first
|
72
46
|
sh "gem install #{file}"
|
73
47
|
end
|
@@ -75,7 +49,7 @@ end
|
|
75
49
|
|
76
50
|
desc "Run the test suite"
|
77
51
|
Rake::TestTask.new("test") do |t|
|
78
|
-
if
|
52
|
+
if WINDOWS
|
79
53
|
t.libs << 'lib'
|
80
54
|
else
|
81
55
|
task :test => :build
|
@@ -83,3 +57,5 @@ Rake::TestTask.new("test") do |t|
|
|
83
57
|
t.libs.delete('lib')
|
84
58
|
end
|
85
59
|
end
|
60
|
+
|
61
|
+
task :default => :test
|
data/ext/sys/uname.c
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
#include <ruby.h>
|
7
7
|
#include <sys/utsname.h>
|
8
8
|
|
9
|
-
#define SYS_UNAME_VERSION "0.8.
|
9
|
+
#define SYS_UNAME_VERSION "0.8.5"
|
10
10
|
|
11
11
|
/* Solaris */
|
12
12
|
#ifdef HAVE_SYS_SYSTEMINFO_H
|
@@ -298,7 +298,7 @@ void Init_uname()
|
|
298
298
|
#endif
|
299
299
|
NULL);
|
300
300
|
|
301
|
-
/* 0.8.
|
301
|
+
/* 0.8.5: The version of this library */
|
302
302
|
rb_define_const(cUname, "VERSION", rb_str_new2(SYS_UNAME_VERSION));
|
303
303
|
}
|
304
304
|
|
data/sys-uname.gemspec
CHANGED
data/test/test_sys_uname.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
##############################################################################
|
2
2
|
# test_sys_uname.rb
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
4
|
+
# Tests for the sys-uname library. This test suite should be run via the
|
5
|
+
# 'rake test' task.
|
6
6
|
##############################################################################
|
7
7
|
require 'rubygems'
|
8
8
|
gem 'test-unit'
|
@@ -13,436 +13,436 @@ require 'rbconfig'
|
|
13
13
|
include Sys
|
14
14
|
|
15
15
|
class TC_Sys_Uname < Test::Unit::TestCase
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
def self.startup
|
17
|
+
@@host_os = Config::CONFIG['host_os']
|
18
|
+
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
def test_version_constant
|
21
|
+
assert_not_nil(Uname::VERSION)
|
22
|
+
assert_nothing_raised{ Uname::VERSION }
|
23
|
+
assert_kind_of(String, Uname::VERSION)
|
24
|
+
assert_equal('0.8.5', Uname::VERSION)
|
25
|
+
end
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
def test_machine
|
28
|
+
assert_respond_to(Uname, :machine)
|
29
|
+
assert_nothing_raised{ Uname.machine }
|
30
|
+
assert_kind_of(String, Uname.machine)
|
31
|
+
end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
def test_version_method
|
34
|
+
assert_respond_to(Uname, :version)
|
35
|
+
assert_nothing_raised{ Uname.version }
|
36
|
+
assert_kind_of(String, Uname.version)
|
37
|
+
end
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
def test_nodename
|
40
|
+
assert_respond_to(Uname, :nodename)
|
41
|
+
assert_nothing_raised{ Uname.nodename }
|
42
|
+
assert_kind_of(String, Uname.nodename)
|
43
|
+
end
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
45
|
+
def test_release
|
46
|
+
assert_respond_to(Uname, :release)
|
47
|
+
assert_nothing_raised{ Uname.release }
|
48
|
+
assert_kind_of(String, Uname.release)
|
49
|
+
end
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
def test_sysname
|
52
|
+
assert_respond_to(Uname, :sysname)
|
53
|
+
assert_nothing_raised{ Uname.sysname }
|
54
|
+
assert_kind_of(String, Uname.sysname, 'Invalid Type')
|
55
|
+
end
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
def test_architecture
|
58
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
59
|
+
assert_respond_to(Uname, :architecture)
|
60
|
+
assert_nothing_raised{ Uname.architecture }
|
61
|
+
assert_kind_of(String, Uname.architecture)
|
62
|
+
end
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
def test_platform
|
65
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
66
|
+
assert_respond_to(Uname, :platform)
|
67
|
+
assert_nothing_raised{ Uname.platform }
|
68
|
+
assert_kind_of(String, Uname.platform)
|
69
|
+
end
|
70
70
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
71
|
+
def test_isa_list
|
72
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
73
|
+
assert_respond_to(Uname, :isa_list)
|
74
|
+
assert_nothing_raised{ Uname.isa_list }
|
75
|
+
assert_kind_of(String, Uname.isa_list)
|
76
|
+
end
|
77
77
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
78
|
+
def test_hw_provider
|
79
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
80
|
+
assert_respond_to(Uname,:hw_provider)
|
81
|
+
assert_nothing_raised{ Uname.hw_provider }
|
82
|
+
assert_kind_of(String, Uname.hw_provider)
|
83
|
+
end
|
84
84
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
85
|
+
def test_hw_serial_number
|
86
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
87
|
+
assert_respond_to(Uname, :hw_serial_number)
|
88
|
+
assert_nothing_raised{ Uname.hw_serial_number }
|
89
|
+
assert_kind_of(Integer, Uname.hw_serial_number)
|
90
|
+
end
|
91
91
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
92
|
+
def test_srpc_domain
|
93
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
94
|
+
assert_respond_to(Uname, :srpc_domain)
|
95
|
+
assert_nothing_raised{ Uname.srpc_domain }
|
96
|
+
assert_kind_of(String, Uname.srpc_domain)
|
97
|
+
end
|
98
98
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
99
|
+
def test_dhcp_cache
|
100
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
101
|
+
assert_respond_to(Uname, :dhcp_cache)
|
102
|
+
assert_nothing_raised{ Uname.dhcp_cache }
|
103
|
+
assert_kind_of(String, Uname.dhcp_cache)
|
104
|
+
end
|
105
105
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
106
|
+
def test_model
|
107
|
+
omit_unless(@@host_os =~ /darwin|powerpc|bsd|mach/i, "BSD/Darwin only")
|
108
|
+
assert_respond_to(Uname, :model)
|
109
|
+
assert_nothing_raised{ Uname.model }
|
110
|
+
assert_kind_of(String, Uname.model)
|
111
|
+
end
|
112
112
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
113
|
+
def test_id_number
|
114
|
+
omit_unless(@@host_os =~ /hpux/i, "HP-UX only")
|
115
|
+
assert_respond_to(Uname, :id_number)
|
116
|
+
assert_nothing_raised{ Uname.id_number }
|
117
|
+
assert_kind_of(String, Uname.id_number)
|
118
|
+
end
|
119
119
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
120
|
+
def test_uname_struct
|
121
|
+
members = %w/sysname nodename machine version release/
|
122
|
+
case Config::CONFIG['host_os']
|
123
|
+
when /sunos|solaris/i
|
124
|
+
members.push('architecture','platform')
|
125
|
+
when /powerpc|darwin/i
|
126
|
+
members.push('model')
|
127
|
+
when /hpux/i
|
128
|
+
members.push('id')
|
129
|
+
when /win32|mingw|cygwin|dos/i
|
130
|
+
members = %w/
|
131
|
+
boot_device build_number build_type caption code_set country_code
|
132
|
+
creation_class_name cscreation_class_name csd_version cs_name
|
133
|
+
current_time_zone debug description distributed
|
134
|
+
foreground_application_boost free_physical_memory
|
135
|
+
free_space_in_paging_files free_virtual_memory
|
136
|
+
install_date last_bootup_time local_date_time locale
|
137
|
+
manufacturer max_number_of_processes max_process_memory_size
|
138
|
+
name number_of_licensed_users number_of_processes
|
139
|
+
number_of_users organization os_language os_product_suite
|
140
|
+
os_type other_type_description plus_product_id
|
141
|
+
plus_version_number primary quantum_length quantum_type
|
142
|
+
registered_user serial_number service_pack_major_version
|
143
|
+
service_pack_minor_version size_stored_in_paging_files
|
144
|
+
status system_device system_directory total_swap_space_size
|
145
|
+
total_virtual_memory_size total_visible_memory_size version
|
146
|
+
windows_directory
|
147
|
+
/
|
148
|
+
end
|
149
|
+
assert_nothing_raised{ Uname.uname }
|
150
|
+
assert_kind_of(Struct, Uname.uname)
|
151
|
+
assert_equal(members, Uname.uname.members)
|
152
|
+
end
|
153
153
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
154
|
+
# The following tests are win32 only
|
155
|
+
if Config::CONFIG['host_os'] =~ /mswin|windows/i
|
156
|
+
def test_boot_device
|
157
|
+
assert_nothing_raised{ Uname.uname.boot_device }
|
158
|
+
assert_kind_of(String, Uname.uname.boot_device)
|
159
|
+
end
|
160
|
+
|
161
|
+
def test_build_number
|
162
|
+
assert_nothing_raised{ Uname.uname.build_number }
|
163
|
+
assert_kind_of(String, Uname.uname.build_number)
|
164
|
+
end
|
165
|
+
|
166
|
+
def test_build_type
|
167
|
+
assert_nothing_raised{ Uname.uname.build_type }
|
168
|
+
assert_kind_of(String, Uname.uname.build_type)
|
169
|
+
end
|
170
|
+
|
171
|
+
def test_caption
|
172
|
+
assert_nothing_raised{ Uname.uname.caption }
|
173
|
+
assert_kind_of(String, Uname.uname.caption)
|
174
|
+
end
|
175
|
+
|
176
|
+
def test_code_set
|
177
|
+
assert_nothing_raised{ Uname.uname.code_set }
|
178
|
+
assert_kind_of(String, Uname.uname.code_set)
|
179
|
+
end
|
180
|
+
|
181
|
+
def test_country_code
|
182
|
+
assert_nothing_raised{ Uname.uname.country_code }
|
183
|
+
assert_kind_of(String, Uname.uname.country_code)
|
184
|
+
end
|
185
|
+
|
186
|
+
def test_creation_class_name
|
187
|
+
assert_nothing_raised{ Uname.uname.creation_class_name }
|
188
|
+
assert_kind_of(String, Uname.uname.creation_class_name)
|
189
|
+
end
|
190
|
+
|
191
|
+
def test_cscreation_class_name
|
192
|
+
assert_nothing_raised{ Uname.uname.cscreation_class_name }
|
193
|
+
assert_kind_of(String, Uname.uname.cscreation_class_name)
|
194
|
+
end
|
195
|
+
|
196
|
+
def test_csd_version
|
197
|
+
assert_nothing_raised{ Uname.uname.csd_version }
|
198
|
+
assert_kind_of(String, Uname.uname.csd_version)
|
199
|
+
end
|
200
|
+
|
201
|
+
def test_cs_name
|
202
|
+
assert_nothing_raised{ Uname.uname.cs_name }
|
203
|
+
assert_kind_of(String, Uname.uname.cs_name)
|
204
|
+
end
|
205
|
+
|
206
|
+
def test_current_time_zone
|
207
|
+
assert_nothing_raised{ Uname.uname.current_time_zone }
|
208
|
+
assert_kind_of(Fixnum, Uname.uname.current_time_zone)
|
209
|
+
end
|
210
|
+
|
211
|
+
def test_debug
|
212
|
+
assert_nothing_raised{ Uname.uname.debug }
|
213
|
+
assert_boolean(Uname.uname.debug)
|
214
|
+
end
|
215
|
+
|
216
|
+
def test_description
|
217
|
+
assert_nothing_raised{ Uname.uname.description }
|
218
|
+
assert_kind_of(String, Uname.uname.description)
|
219
|
+
end
|
220
|
+
|
221
|
+
def test_distributed
|
222
|
+
assert_nothing_raised{ Uname.uname.distributed }
|
223
|
+
assert_boolean(Uname.uname.distributed)
|
224
|
+
end
|
225
|
+
|
226
|
+
# Not yet supported - WinXP or later only
|
227
|
+
#def test_encryption_level
|
228
|
+
# assert_nothing_raised{ Uname.uname.encryption_level }
|
229
|
+
# assert_kind_of(Fixnum,Uname.uname.encryption_level)
|
230
|
+
#end
|
231
231
|
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
232
|
+
def test_foreground_application_boost
|
233
|
+
assert_nothing_raised{ Uname.uname.foreground_application_boost }
|
234
|
+
assert_kind_of(Fixnum, Uname.uname.foreground_application_boost)
|
235
|
+
end
|
236
|
+
|
237
|
+
def test_free_physical_memory
|
238
|
+
assert_nothing_raised{ Uname.uname.free_physical_memory }
|
239
|
+
assert_kind_of(Fixnum, Uname.uname.free_physical_memory)
|
240
|
+
end
|
241
|
+
|
242
|
+
def test_free_space_in_paging_files
|
243
|
+
assert_nothing_raised{ Uname.uname.free_space_in_paging_files }
|
244
|
+
assert_kind_of(Fixnum, Uname.uname.free_space_in_paging_files)
|
245
|
+
end
|
246
|
+
|
247
|
+
def test_free_virtual_memory
|
248
|
+
assert_nothing_raised{ Uname.uname.free_virtual_memory}
|
249
|
+
assert_kind_of(Fixnum, Uname.uname.free_virtual_memory)
|
250
|
+
end
|
251
|
+
|
252
|
+
def test_install_date
|
253
|
+
assert_nothing_raised{ Uname.uname.install_date}
|
254
|
+
assert_kind_of(Time, Uname.uname.install_date)
|
255
|
+
end
|
256
|
+
|
257
|
+
# Not yet supported - WinXP or later only
|
258
|
+
#def test_large_system_cache
|
259
|
+
# assert_nothing_raised{ Uname.uname.large_system_cache}
|
260
|
+
# assert_kind_of(Time,Uname.uname.large_system_cache)
|
261
|
+
#end
|
262
262
|
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
263
|
+
def test_last_bootup_time
|
264
|
+
assert_nothing_raised{ Uname.uname.last_bootup_time}
|
265
|
+
assert_kind_of(Time, Uname.uname.last_bootup_time)
|
266
|
+
end
|
267
|
+
|
268
|
+
def test_local_date_time
|
269
|
+
assert_nothing_raised{ Uname.uname.local_date_time}
|
270
|
+
assert_kind_of(Time, Uname.uname.local_date_time)
|
271
|
+
end
|
272
|
+
|
273
|
+
def test_locale
|
274
|
+
assert_nothing_raised{ Uname.uname.locale}
|
275
|
+
assert_kind_of(String, Uname.uname.locale)
|
276
|
+
end
|
277
|
+
|
278
|
+
def test_manufacturer
|
279
|
+
assert_nothing_raised{ Uname.uname.manufacturer}
|
280
|
+
assert_kind_of(String, Uname.uname.manufacturer)
|
281
|
+
end
|
282
|
+
|
283
|
+
def test_max_number_of_processes
|
284
|
+
assert_nothing_raised{ Uname.uname.max_number_of_processes}
|
285
|
+
assert_kind_of(Fixnum, Uname.uname.max_number_of_processes)
|
286
|
+
end
|
287
|
+
|
288
|
+
def test_max_process_memory_size
|
289
|
+
assert_nothing_raised{ Uname.uname.max_process_memory_size}
|
290
|
+
assert_kind_of(Integer, Uname.uname.max_process_memory_size)
|
291
|
+
end
|
292
|
+
|
293
|
+
def test_name
|
294
|
+
assert_nothing_raised{ Uname.uname.name}
|
295
|
+
assert_kind_of(String, Uname.uname.name)
|
296
|
+
end
|
297
|
+
|
298
|
+
# Fails on Win XP Pro - returns nil - reason unknown
|
299
|
+
#def test_number_of_licensed_users
|
300
|
+
# assert_nothing_raised{ Uname.uname.number_of_licensed_users}
|
301
|
+
# assert_kind_of(Fixnum,Uname.uname.number_of_licensed_users)
|
302
|
+
#end
|
303
303
|
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
304
|
+
def test_number_of_processes
|
305
|
+
assert_nothing_raised{ Uname.uname.number_of_processes}
|
306
|
+
assert_kind_of(Fixnum, Uname.uname.number_of_processes)
|
307
|
+
end
|
308
|
+
|
309
|
+
def test_number_of_users
|
310
|
+
assert_nothing_raised{ Uname.uname.number_of_users}
|
311
|
+
assert_kind_of(Fixnum, Uname.uname.number_of_users)
|
312
|
+
end
|
313
|
+
|
314
|
+
def test_organization
|
315
|
+
assert_nothing_raised{ Uname.uname.organization}
|
316
|
+
assert_kind_of(String, Uname.uname.organization)
|
317
|
+
end
|
318
|
+
|
319
|
+
# Eventually replace Fixnum with a string (?)
|
320
|
+
def test_os_language
|
321
|
+
assert_nothing_raised{ Uname.uname.os_language}
|
322
|
+
assert_kind_of(Fixnum, Uname.uname.os_language)
|
323
|
+
end
|
324
|
+
|
325
|
+
# Fails on Win XP Pro - returns nil - reason unknown
|
326
|
+
#def test_os_product_suite
|
327
|
+
# assert_nothing_raised{ Uname.uname.os_product_suite}
|
328
|
+
# assert_kind_of(Fixnum,Uname.uname.os_product_suite)
|
329
|
+
#end
|
330
330
|
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
331
|
+
def test_os_type
|
332
|
+
assert_nothing_raised{ Uname.uname.os_type}
|
333
|
+
assert_kind_of(Fixnum, Uname.uname.os_type)
|
334
|
+
end
|
335
|
+
|
336
|
+
# Fails?
|
337
|
+
#def test_other_type_restriction
|
338
|
+
# assert_nothing_raised{ Uname.uname.other_type_restriction}
|
339
|
+
# assert_kind_of(Fixnum,Uname.uname.other_type_restriction)
|
340
|
+
#end
|
341
341
|
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
342
|
+
# Might be nil
|
343
|
+
def test_plus_product_id
|
344
|
+
assert_nothing_raised{ Uname.uname.plus_product_id}
|
345
|
+
end
|
346
346
|
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
347
|
+
# Might be nil
|
348
|
+
def test_plus_version_number
|
349
|
+
assert_nothing_raised{ Uname.uname.plus_version_number}
|
350
|
+
end
|
351
|
+
|
352
|
+
def test_primary
|
353
|
+
assert_nothing_raised{ Uname.uname.primary}
|
354
|
+
assert_boolean(Uname.uname.primary)
|
355
|
+
end
|
356
|
+
|
357
|
+
# Not yet supported - WinXP or later only
|
358
|
+
# def test_product_type
|
359
|
+
# assert_nothing_raised{ Uname.uname.product_type}
|
360
|
+
# assert_kind_of(Fixnum,Uname.uname.product_type)
|
361
|
+
# end
|
362
362
|
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
363
|
+
def test_quantum_length
|
364
|
+
assert_nothing_raised{ Uname.uname.quantum_length}
|
365
|
+
assert_kind_of(Fixnum, Uname.uname.quantum_length)
|
366
|
+
end
|
367
|
+
|
368
|
+
def test_quantum_type
|
369
|
+
assert_nothing_raised{ Uname.uname.quantum_type}
|
370
|
+
assert_kind_of(Fixnum, Uname.uname.quantum_type)
|
371
|
+
end
|
372
|
+
|
373
|
+
def test_registered_user
|
374
|
+
assert_nothing_raised{ Uname.uname.registered_user}
|
375
|
+
assert_kind_of(String, Uname.uname.registered_user)
|
376
|
+
end
|
377
|
+
|
378
|
+
def test_serial_number
|
379
|
+
assert_nothing_raised{ Uname.uname.serial_number}
|
380
|
+
assert_kind_of(String, Uname.uname.serial_number)
|
381
|
+
end
|
382
|
+
|
383
|
+
# This is nil on NT 4
|
384
|
+
def test_service_pack_major_version
|
385
|
+
assert_nothing_raised{ Uname.uname.service_pack_major_version}
|
386
|
+
assert_kind_of(Fixnum, Uname.uname.service_pack_major_version)
|
387
|
+
end
|
388
|
+
|
389
|
+
# This is nil on NT 4
|
390
|
+
def test_service_pack_major_version
|
391
|
+
assert_nothing_raised{ Uname.uname.service_pack_minor_version}
|
392
|
+
assert_kind_of(Fixnum, Uname.uname.service_pack_minor_version)
|
393
|
+
end
|
394
|
+
|
395
|
+
def test_status
|
396
|
+
assert_nothing_raised{ Uname.uname.status}
|
397
|
+
assert_kind_of(String, Uname.uname.status)
|
398
|
+
end
|
399
|
+
|
400
|
+
# Not yet supported - WinXP or later only
|
401
|
+
#def test_suite_mask
|
402
|
+
# assert_nothing_raised{ Uname.uname.suite_mask}
|
403
|
+
# assert_kind_of(String,Uname.uname.suite_mask)
|
404
|
+
#end
|
405
405
|
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
406
|
+
def test_system_device
|
407
|
+
assert_nothing_raised{ Uname.uname.system_device}
|
408
|
+
assert_kind_of(String, Uname.uname.system_device)
|
409
|
+
end
|
410
|
+
|
411
|
+
def test_system_directory
|
412
|
+
assert_nothing_raised{ Uname.uname.system_directory}
|
413
|
+
assert_kind_of(String, Uname.uname.system_directory)
|
414
|
+
end
|
415
|
+
|
416
|
+
# Not yet supported - WinXP or later only
|
417
|
+
#def test_system_drive
|
418
|
+
# assert_nothing_raised{ Uname.uname.system_drive}
|
419
|
+
# assert_kind_of(String,Uname.uname.system_drive)
|
420
|
+
#end
|
421
421
|
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
422
|
+
# Fails on Win XP Pro - returns nil - reason unknown
|
423
|
+
#def test_total_swap_space_size
|
424
|
+
# assert_nothing_raised{ Uname.uname.total_swap_space_size}
|
425
|
+
# assert_kind_of(Fixnum,Uname.uname.total_swap_space_size)
|
426
|
+
#end
|
427
|
+
|
428
|
+
def test_total_virtual_memory_size
|
429
|
+
assert_nothing_raised{ Uname.uname.total_virtual_memory_size}
|
430
|
+
assert_kind_of(Fixnum, Uname.uname.total_virtual_memory_size)
|
431
|
+
end
|
432
|
+
|
433
|
+
def test_total_visible_memory_size
|
434
|
+
assert_nothing_raised{ Uname.uname.total_visible_memory_size}
|
435
|
+
assert_kind_of(Fixnum, Uname.uname.total_visible_memory_size)
|
436
|
+
end
|
437
|
+
|
438
|
+
def test_version
|
439
|
+
assert_nothing_raised{ Uname.uname.version}
|
440
|
+
assert_kind_of(String, Uname.uname.version)
|
441
|
+
end
|
442
|
+
|
443
|
+
def test_windows_directory
|
444
|
+
assert_nothing_raised{ Uname.uname.windows_directory}
|
445
|
+
assert_kind_of(String, Uname.uname.windows_directory)
|
446
|
+
end
|
447
|
+
end
|
448
448
|
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-uname
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 53
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 8
|
9
|
+
- 5
|
10
|
+
version: 0.8.5
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Daniel J. Berger
|
@@ -9,19 +15,25 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-12-11 00:00:00 -07:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: test-unit
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 0
|
33
|
+
- 6
|
23
34
|
version: 2.0.6
|
24
|
-
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
25
37
|
description: " The sys-uname library provides an interface for gathering information\n about your current platform. The library is named after the Unix 'uname'\n command but also works on MS Windows. Available information includes\n OS name, OS version, system name and so on. Additional information is\n available for certain platforms.\n"
|
26
38
|
email: djberg96@gmail.com
|
27
39
|
executables: []
|
@@ -55,21 +67,27 @@ rdoc_options: []
|
|
55
67
|
require_paths:
|
56
68
|
- lib
|
57
69
|
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
58
71
|
requirements:
|
59
72
|
- - ">="
|
60
73
|
- !ruby/object:Gem::Version
|
74
|
+
hash: 3
|
75
|
+
segments:
|
76
|
+
- 0
|
61
77
|
version: "0"
|
62
|
-
version:
|
63
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
64
80
|
requirements:
|
65
81
|
- - ">="
|
66
82
|
- !ruby/object:Gem::Version
|
83
|
+
hash: 3
|
84
|
+
segments:
|
85
|
+
- 0
|
67
86
|
version: "0"
|
68
|
-
version:
|
69
87
|
requirements: []
|
70
88
|
|
71
89
|
rubyforge_project: sysutils
|
72
|
-
rubygems_version: 1.3.
|
90
|
+
rubygems_version: 1.3.7
|
73
91
|
signing_key:
|
74
92
|
specification_version: 3
|
75
93
|
summary: An interface for returning system platform information
|