sys-uname 1.2.1 → 1.2.3
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.rdoc → CHANGES.md} +48 -35
- data/Gemfile +2 -0
- data/{MANIFEST.rdoc → MANIFEST.md} +2 -1
- data/README.md +68 -0
- data/Rakefile +6 -4
- data/doc/uname.rdoc +1 -1
- data/lib/sys/platform.rb +17 -13
- data/lib/sys/uname.rb +3 -1
- data/lib/sys/unix/uname.rb +20 -35
- data/lib/sys/windows/uname.rb +221 -237
- data/lib/sys-uname.rb +2 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/sys_platform_spec.rb +32 -38
- data/spec/sys_uname_spec.rb +141 -137
- data/sys-uname.gemspec +14 -9
- data.tar.gz.sig +0 -0
- metadata +68 -32
- metadata.gz.sig +0 -0
- data/README.rdoc +0 -51
data/lib/sys/windows/uname.rb
CHANGED
@@ -1,21 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'socket'
|
2
4
|
require 'time'
|
3
|
-
|
4
|
-
# See Ruby bugs #2618 and #7681. This is a workaround.
|
5
|
-
BEGIN{
|
6
|
-
require 'win32ole'
|
7
|
-
if RUBY_VERSION.to_f < 2.0
|
8
|
-
WIN32OLE.ole_initialize
|
9
|
-
at_exit { WIN32OLE.ole_uninitialize }
|
10
|
-
end
|
11
|
-
}
|
5
|
+
require 'win32ole'
|
12
6
|
|
13
7
|
# The Sys module provides a namespace only.
|
14
8
|
module Sys
|
15
|
-
|
16
9
|
# The Uname class encapsulates uname (platform) information.
|
17
10
|
class Uname
|
18
|
-
|
19
11
|
# This is the error raised if any of the Sys::Uname methods should fail.
|
20
12
|
class Error < StandardError; end
|
21
13
|
|
@@ -79,7 +71,7 @@ module Sys
|
|
79
71
|
]
|
80
72
|
|
81
73
|
# The UnameStruct is used to store platform information for some methods.
|
82
|
-
UnameStruct = Struct.new(
|
74
|
+
UnameStruct = Struct.new('UnameStruct', *fields)
|
83
75
|
|
84
76
|
# Returns the version plus patch information of the operating system,
|
85
77
|
# separated by a hyphen, e.g. "2915-Service Pack 2".
|
@@ -88,79 +80,73 @@ module Sys
|
|
88
80
|
# the 'InstancesOf' method to get the data we need, rather than
|
89
81
|
# including it as part of the connection.
|
90
82
|
#
|
91
|
-
def self.version(host=Socket.gethostname)
|
83
|
+
def self.version(host = Socket.gethostname)
|
92
84
|
cs = "winmgmts://#{host}/root/cimv2"
|
93
85
|
begin
|
94
86
|
wmi = WIN32OLE.connect(cs)
|
95
|
-
rescue WIN32OLERuntimeError =>
|
96
|
-
raise Error,
|
87
|
+
rescue WIN32OLERuntimeError => err
|
88
|
+
raise Error, err
|
97
89
|
else
|
98
|
-
wmi.InstancesOf(
|
99
|
-
|
100
|
-
|
101
|
-
return str
|
102
|
-
}
|
90
|
+
ole = wmi.InstancesOf('Win32_OperatingSystem').ItemIndex(0)
|
91
|
+
str = "#{ole.Version} #{ole.BuildNumber}-"
|
92
|
+
"#{str}#{ole.ServicePackMajorVersion}"
|
103
93
|
end
|
104
94
|
end
|
105
95
|
|
106
96
|
# Returns the operating system name, e.g. "Microsoft Windows XP Home"
|
107
97
|
#
|
108
|
-
def self.sysname(host=Socket.gethostname)
|
109
|
-
cs =
|
110
|
-
cs
|
98
|
+
def self.sysname(host = Socket.gethostname)
|
99
|
+
cs = 'winmgmts:{impersonationLevel=impersonate,(security)}'
|
100
|
+
cs += "//#{host}/root/cimv2"
|
111
101
|
begin
|
112
102
|
wmi = WIN32OLE.connect(cs)
|
113
|
-
rescue WIN32OLERuntimeError =>
|
114
|
-
raise Error,
|
103
|
+
rescue WIN32OLERuntimeError => err
|
104
|
+
raise Error, err
|
115
105
|
else
|
116
|
-
wmi.InstancesOf(
|
117
|
-
return ole.Caption
|
118
|
-
}
|
106
|
+
wmi.InstancesOf('Win32_OperatingSystem').ItemIndex(0).Caption.strip
|
119
107
|
end
|
120
108
|
end
|
121
109
|
|
122
110
|
# Returns the nodename. This is usually, but not necessarily, the
|
123
111
|
# same as the system's hostname.
|
124
112
|
#
|
125
|
-
def self.nodename(host=Socket.gethostname)
|
126
|
-
cs =
|
127
|
-
cs
|
113
|
+
def self.nodename(host = Socket.gethostname)
|
114
|
+
cs = 'winmgmts:{impersonationLevel=impersonate,(security)}'
|
115
|
+
cs += "//#{host}/root/cimv2"
|
128
116
|
begin
|
129
117
|
wmi = WIN32OLE.connect(cs)
|
130
|
-
rescue WIN32OLERuntimeError =>
|
131
|
-
raise Error,
|
118
|
+
rescue WIN32OLERuntimeError => err
|
119
|
+
raise Error, err
|
132
120
|
else
|
133
|
-
wmi.InstancesOf(
|
134
|
-
return ole.CSName
|
135
|
-
}
|
121
|
+
wmi.InstancesOf('Win32_OperatingSystem').ItemIndex(0).CSName
|
136
122
|
end
|
137
123
|
end
|
138
124
|
|
139
125
|
# Returns the CPU architecture, e.g. "x86"
|
140
126
|
#
|
141
|
-
def self.architecture(cpu_num=0, host=Socket.gethostname)
|
142
|
-
cs =
|
143
|
-
cs
|
127
|
+
def self.architecture(cpu_num = 0, host = Socket.gethostname)
|
128
|
+
cs = 'winmgmts:{impersonationLevel=impersonate,(security)}'
|
129
|
+
cs += "//#{host}/root/cimv2:Win32_Processor='cpu#{cpu_num}'"
|
144
130
|
begin
|
145
131
|
wmi = WIN32OLE.connect(cs)
|
146
|
-
rescue WIN32OLERuntimeError =>
|
147
|
-
raise Error,
|
132
|
+
rescue WIN32OLERuntimeError => err
|
133
|
+
raise Error, err
|
148
134
|
else
|
149
135
|
case wmi.Architecture
|
150
136
|
when 0
|
151
|
-
|
137
|
+
'x86'
|
152
138
|
when 1
|
153
|
-
|
139
|
+
'mips'
|
154
140
|
when 2
|
155
|
-
|
141
|
+
'alpha'
|
156
142
|
when 3
|
157
|
-
|
143
|
+
'powerpc'
|
158
144
|
when 6
|
159
|
-
|
145
|
+
'ia64'
|
160
146
|
when 9
|
161
|
-
|
147
|
+
'x86_64'
|
162
148
|
else
|
163
|
-
|
149
|
+
'unknown'
|
164
150
|
end
|
165
151
|
end
|
166
152
|
end
|
@@ -171,252 +157,248 @@ module Sys
|
|
171
157
|
# were unknown to the OS when the OS was originally released. It
|
172
158
|
# appears that MS doesn't necessarily patch this, either.
|
173
159
|
#
|
174
|
-
def self.machine(cpu_num=0, host=Socket.gethostname)
|
175
|
-
cs =
|
176
|
-
cs
|
160
|
+
def self.machine(cpu_num = 0, host = Socket.gethostname)
|
161
|
+
cs = 'winmgmts:{impersonationLevel=impersonate,(security)}'
|
162
|
+
cs += "//#{host}/root/cimv2:Win32_Processor='cpu#{cpu_num}'"
|
177
163
|
begin
|
178
164
|
wmi = WIN32OLE.connect(cs)
|
179
|
-
rescue WIN32OLERuntimeError =>
|
180
|
-
raise Error,
|
165
|
+
rescue WIN32OLERuntimeError => err
|
166
|
+
raise Error, err
|
181
167
|
else
|
182
168
|
# Convert a family number into the equivalent string
|
183
169
|
case wmi.Family
|
184
170
|
when 1
|
185
|
-
|
186
|
-
when 2
|
187
|
-
return "Unknown"
|
171
|
+
'Other'
|
188
172
|
when 3
|
189
|
-
|
173
|
+
'8086'
|
190
174
|
when 4
|
191
|
-
|
175
|
+
'80286'
|
192
176
|
when 5
|
193
|
-
|
177
|
+
'80386'
|
194
178
|
when 6
|
195
|
-
|
179
|
+
'80486'
|
196
180
|
when 7
|
197
|
-
|
181
|
+
'8087'
|
198
182
|
when 8
|
199
|
-
|
183
|
+
'80287'
|
200
184
|
when 9
|
201
|
-
|
185
|
+
'80387'
|
202
186
|
when 10
|
203
|
-
|
187
|
+
'80487'
|
204
188
|
when 11
|
205
|
-
|
189
|
+
'Pentium brand'
|
206
190
|
when 12
|
207
|
-
|
191
|
+
'Pentium Pro'
|
208
192
|
when 13
|
209
|
-
|
193
|
+
'Pentium II'
|
210
194
|
when 14
|
211
|
-
|
195
|
+
'Pentium processor with MMX technology'
|
212
196
|
when 15
|
213
|
-
|
197
|
+
'Celeron'
|
214
198
|
when 16
|
215
|
-
|
199
|
+
'Pentium II Xeon'
|
216
200
|
when 17
|
217
|
-
|
201
|
+
'Pentium III'
|
218
202
|
when 18
|
219
|
-
|
203
|
+
'M1 Family'
|
220
204
|
when 19
|
221
|
-
|
205
|
+
'M2 Family'
|
222
206
|
when 24
|
223
|
-
|
207
|
+
'K5 Family'
|
224
208
|
when 25
|
225
|
-
|
209
|
+
'K6 Family'
|
226
210
|
when 26
|
227
|
-
|
211
|
+
'K6-2'
|
228
212
|
when 27
|
229
|
-
|
213
|
+
'K6-3'
|
230
214
|
when 28
|
231
|
-
|
215
|
+
'AMD Athlon Processor Family'
|
232
216
|
when 29
|
233
|
-
|
217
|
+
'AMD Duron Processor'
|
234
218
|
when 30
|
235
|
-
|
219
|
+
'AMD2900 Family'
|
236
220
|
when 31
|
237
|
-
|
221
|
+
'K6-2+'
|
238
222
|
when 32
|
239
|
-
|
223
|
+
'Power PC Family'
|
240
224
|
when 33
|
241
|
-
|
225
|
+
'Power PC 601'
|
242
226
|
when 34
|
243
|
-
|
227
|
+
'Power PC 603'
|
244
228
|
when 35
|
245
|
-
|
229
|
+
'Power PC 603+'
|
246
230
|
when 36
|
247
|
-
|
231
|
+
'Power PC 604'
|
248
232
|
when 37
|
249
|
-
|
233
|
+
'Power PC 620'
|
250
234
|
when 38
|
251
|
-
|
235
|
+
'Power PC X704'
|
252
236
|
when 39
|
253
|
-
|
237
|
+
'Power PC 750'
|
254
238
|
when 48
|
255
|
-
|
239
|
+
'Alpha Family'
|
256
240
|
when 49
|
257
|
-
|
241
|
+
'Alpha 21064'
|
258
242
|
when 50
|
259
|
-
|
243
|
+
'Alpha 21066'
|
260
244
|
when 51
|
261
|
-
|
245
|
+
'Alpha 21164'
|
262
246
|
when 52
|
263
|
-
|
247
|
+
'Alpha 21164PC'
|
264
248
|
when 53
|
265
|
-
|
249
|
+
'Alpha 21164a'
|
266
250
|
when 54
|
267
|
-
|
251
|
+
'Alpha 21264'
|
268
252
|
when 55
|
269
|
-
|
253
|
+
'Alpha 21364'
|
270
254
|
when 64
|
271
|
-
|
255
|
+
'MIPS Family'
|
272
256
|
when 65
|
273
|
-
|
257
|
+
'MIPS R4000'
|
274
258
|
when 66
|
275
|
-
|
259
|
+
'MIPS R4200'
|
276
260
|
when 67
|
277
|
-
|
261
|
+
'MIPS R4400'
|
278
262
|
when 68
|
279
|
-
|
263
|
+
'MIPS R4600'
|
280
264
|
when 69
|
281
|
-
|
265
|
+
'MIPS R10000'
|
282
266
|
when 80
|
283
|
-
|
267
|
+
'SPARC Family'
|
284
268
|
when 81
|
285
|
-
|
269
|
+
'SuperSPARC'
|
286
270
|
when 82
|
287
|
-
|
271
|
+
'microSPARC II'
|
288
272
|
when 83
|
289
|
-
|
273
|
+
'microSPARC IIep'
|
290
274
|
when 84
|
291
|
-
|
275
|
+
'UltraSPARC'
|
292
276
|
when 85
|
293
|
-
|
277
|
+
'UltraSPARC II'
|
294
278
|
when 86
|
295
|
-
|
279
|
+
'UltraSPARC IIi'
|
296
280
|
when 87
|
297
|
-
|
281
|
+
'UltraSPARC III'
|
298
282
|
when 88
|
299
|
-
|
283
|
+
'UltraSPARC IIIi'
|
300
284
|
when 96
|
301
|
-
|
285
|
+
'68040'
|
302
286
|
when 97
|
303
|
-
|
287
|
+
'68xxx Family'
|
304
288
|
when 98
|
305
|
-
|
289
|
+
'68000'
|
306
290
|
when 99
|
307
|
-
|
291
|
+
'68010'
|
308
292
|
when 100
|
309
|
-
|
293
|
+
'68020'
|
310
294
|
when 101
|
311
|
-
|
295
|
+
'68030'
|
312
296
|
when 112
|
313
|
-
|
297
|
+
'Hobbit Family'
|
314
298
|
when 120
|
315
|
-
|
299
|
+
'Crusoe TM5000 Family'
|
316
300
|
when 121
|
317
|
-
|
301
|
+
'Crusoe TM3000 Family'
|
318
302
|
when 122
|
319
|
-
|
303
|
+
'Efficeon TM8000 Family'
|
320
304
|
when 128
|
321
|
-
|
305
|
+
'Weitek'
|
322
306
|
when 130
|
323
|
-
|
307
|
+
'Itanium Processor'
|
324
308
|
when 131
|
325
|
-
|
309
|
+
'AMD Athlon 64 Processor Family'
|
326
310
|
when 132
|
327
|
-
|
311
|
+
'AMD Opteron Processor Family'
|
328
312
|
when 144
|
329
|
-
|
313
|
+
'PA-RISC Family'
|
330
314
|
when 145
|
331
|
-
|
315
|
+
'PA-RISC 8500'
|
332
316
|
when 146
|
333
|
-
|
317
|
+
'PA-RISC 8000'
|
334
318
|
when 147
|
335
|
-
|
319
|
+
'PA-RISC 7300LC'
|
336
320
|
when 148
|
337
|
-
|
321
|
+
'PA-RISC 7200'
|
338
322
|
when 149
|
339
|
-
|
323
|
+
'PA-RISC 7100LC'
|
340
324
|
when 150
|
341
|
-
|
325
|
+
'PA-RISC 7100'
|
342
326
|
when 160
|
343
|
-
|
327
|
+
'V30 Family'
|
344
328
|
when 176
|
345
|
-
|
329
|
+
'Pentium III Xeon'
|
346
330
|
when 177
|
347
|
-
|
331
|
+
'Pentium III Processor with Intel SpeedStep Technology'
|
348
332
|
when 178
|
349
|
-
|
333
|
+
'Pentium 4'
|
350
334
|
when 179
|
351
|
-
|
335
|
+
'Intel Xeon'
|
352
336
|
when 180
|
353
|
-
|
337
|
+
'AS400 Family'
|
354
338
|
when 181
|
355
|
-
|
339
|
+
'Intel Xeon processor MP'
|
356
340
|
when 182
|
357
|
-
|
341
|
+
'AMD AthlonXP Family'
|
358
342
|
when 183
|
359
|
-
|
343
|
+
'AMD AthlonMP Family'
|
360
344
|
when 184
|
361
|
-
|
345
|
+
'Intel Itanium 2'
|
362
346
|
when 185
|
363
|
-
|
347
|
+
'AMD Opteron Family'
|
364
348
|
when 190
|
365
|
-
|
349
|
+
'K7'
|
366
350
|
when 198
|
367
|
-
|
351
|
+
'Intel Core i7-2760QM'
|
368
352
|
when 200
|
369
|
-
|
353
|
+
'IBM390 Family'
|
370
354
|
when 201
|
371
|
-
|
355
|
+
'G4'
|
372
356
|
when 202
|
373
|
-
|
357
|
+
'G5'
|
374
358
|
when 203
|
375
|
-
|
359
|
+
'G6'
|
376
360
|
when 204
|
377
|
-
|
361
|
+
'z/Architecture Base'
|
378
362
|
when 250
|
379
|
-
|
363
|
+
'i860'
|
380
364
|
when 251
|
381
|
-
|
365
|
+
'i960'
|
382
366
|
when 260
|
383
|
-
|
367
|
+
'SH-3'
|
384
368
|
when 261
|
385
|
-
|
369
|
+
'SH-4'
|
386
370
|
when 280
|
387
|
-
|
371
|
+
'ARM'
|
388
372
|
when 281
|
389
|
-
|
373
|
+
'StrongARM'
|
390
374
|
when 300
|
391
|
-
|
375
|
+
'6x86'
|
392
376
|
when 301
|
393
|
-
|
377
|
+
'MediaGX'
|
394
378
|
when 302
|
395
|
-
|
379
|
+
'MII'
|
396
380
|
when 320
|
397
|
-
|
381
|
+
'WinChip'
|
398
382
|
when 350
|
399
|
-
|
383
|
+
'DSP'
|
400
384
|
when 500
|
401
|
-
|
385
|
+
'Video Processor'
|
402
386
|
else
|
403
|
-
|
387
|
+
'Unknown'
|
404
388
|
end
|
405
389
|
end
|
406
390
|
end
|
407
391
|
|
408
392
|
# Returns the release number, e.g. 5.1.2600.
|
409
393
|
#
|
410
|
-
def self.release(host=Socket.gethostname)
|
394
|
+
def self.release(host = Socket.gethostname)
|
411
395
|
cs = "winmgmts://#{host}/root/cimv2"
|
412
396
|
begin
|
413
397
|
wmi = WIN32OLE.connect(cs)
|
414
|
-
rescue WIN32OLERuntimeError =>
|
415
|
-
raise Error,
|
398
|
+
rescue WIN32OLERuntimeError => err
|
399
|
+
raise Error, err
|
416
400
|
else
|
417
|
-
wmi.InstancesOf(
|
418
|
-
return ole.Version
|
419
|
-
}
|
401
|
+
wmi.InstancesOf('Win32_OperatingSystem').ItemIndex(0).Version
|
420
402
|
end
|
421
403
|
end
|
422
404
|
|
@@ -424,92 +406,94 @@ module Sys
|
|
424
406
|
# machine, version, and release, as well as a plethora of other fields.
|
425
407
|
# Please see the MSDN documentation for what each of these fields mean.
|
426
408
|
#
|
427
|
-
def self.uname(host=Socket.gethostname)
|
409
|
+
def self.uname(host = Socket.gethostname)
|
428
410
|
cs = "winmgmts://#{host}/root/cimv2"
|
429
411
|
begin
|
430
412
|
wmi = WIN32OLE.connect(cs)
|
431
|
-
rescue WIN32OLERuntimeError =>
|
432
|
-
raise Error,
|
413
|
+
rescue WIN32OLERuntimeError => err
|
414
|
+
raise Error, err
|
433
415
|
else
|
434
|
-
wmi.InstancesOf(
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
416
|
+
os = wmi.InstancesOf('Win32_OperatingSystem').ItemIndex(0)
|
417
|
+
|
418
|
+
UnameStruct.new(
|
419
|
+
os.BootDevice,
|
420
|
+
os.BuildNumber,
|
421
|
+
os.BuildType,
|
422
|
+
os.Caption,
|
423
|
+
os.CodeSet,
|
424
|
+
os.CountryCode,
|
425
|
+
os.CreationClassName,
|
426
|
+
os.CSCreationClassName,
|
427
|
+
os.CSDVersion,
|
428
|
+
os.CSName,
|
429
|
+
os.CurrentTimeZone,
|
430
|
+
os.Debug,
|
431
|
+
os.Description,
|
432
|
+
os.Distributed,
|
433
|
+
os.EncryptionLevel,
|
434
|
+
os.ForegroundApplicationBoost,
|
435
|
+
convert(os.FreePhysicalMemory),
|
436
|
+
convert(os.FreeSpaceInPagingFiles),
|
437
|
+
convert(os.FreeVirtualMemory),
|
438
|
+
parse_ms_date(os.InstallDate),
|
439
|
+
parse_ms_date(os.LastBootUpTime),
|
440
|
+
parse_ms_date(os.LocalDateTime),
|
441
|
+
os.Locale,
|
442
|
+
os.Manufacturer,
|
443
|
+
os.MaxNumberOfProcesses,
|
444
|
+
convert(os.MaxProcessMemorySize),
|
445
|
+
os.Name,
|
446
|
+
os.NumberOfLicensedUsers,
|
447
|
+
os.NumberOfProcesses,
|
448
|
+
os.NumberOfUsers,
|
449
|
+
os.Organization,
|
450
|
+
os.OSLanguage,
|
451
|
+
os.OSProductSuite,
|
452
|
+
os.OSType,
|
453
|
+
os.OtherTypeDescription,
|
454
|
+
os.PlusProductID,
|
455
|
+
os.PlusVersionNumber,
|
456
|
+
os.Primary,
|
457
|
+
os.ProductType,
|
458
|
+
os.respond_to?(:QuantumLength) ? os.QuantumLength : nil,
|
459
|
+
os.respond_to?(:QuantumType) ? os.QuantumType : nil,
|
460
|
+
os.RegisteredUser,
|
461
|
+
os.SerialNumber,
|
462
|
+
os.ServicePackMajorVersion,
|
463
|
+
os.ServicePackMinorVersion,
|
464
|
+
convert(os.SizeStoredInPagingFiles),
|
465
|
+
os.Status,
|
466
|
+
os.SuiteMask,
|
467
|
+
os.SystemDevice,
|
468
|
+
os.SystemDirectory,
|
469
|
+
os.SystemDrive,
|
470
|
+
convert(os.TotalSwapSpaceSize),
|
471
|
+
convert(os.TotalVirtualMemorySize),
|
472
|
+
convert(os.TotalVisibleMemorySize),
|
473
|
+
os.Version,
|
474
|
+
os.WindowsDirectory
|
475
|
+
)
|
494
476
|
end
|
495
477
|
end
|
496
478
|
|
497
|
-
private
|
498
|
-
|
499
479
|
# Converts a string in the format '20040703074625.015625-360' into a
|
500
480
|
# Ruby Time object.
|
501
481
|
#
|
502
482
|
def self.parse_ms_date(str)
|
503
483
|
return if str.nil?
|
504
|
-
|
484
|
+
Time.parse(str.split('.')[0])
|
505
485
|
end
|
506
486
|
|
487
|
+
private_class_method :parse_ms_date
|
488
|
+
|
507
489
|
# There is a bug in win32ole where uint64 types are returned as a
|
508
490
|
# String rather than a Fixnum/Bignum. This deals with that for now.
|
509
491
|
#
|
510
492
|
def self.convert(str)
|
511
493
|
return nil if str.nil? # Don't turn nil into 0
|
512
|
-
|
494
|
+
str.to_i
|
513
495
|
end
|
496
|
+
|
497
|
+
private_class_method :convert
|
514
498
|
end
|
515
499
|
end
|