sys-proctable 0.9.3-universal-mingw32 → 0.9.4-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CHANGES +11 -0
- data/MANIFEST +5 -3
- data/README +8 -9
- data/Rakefile +32 -21
- data/lib/sys/top.rb +6 -4
- data/lib/windows/sys/proctable.rb +1 -1
- data/sys-proctable.gemspec +3 -2
- data/test/test_sys_proctable_all.rb +2 -5
- metadata +21 -11
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OWY3YTM4MTJiOWU0OTkwNzk1YTYzN2ZmOWZjNjBiYTQwM2NlYWI1MA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YjcyOTE5MTMxYTFjZjc2YjIzNWFlZGZlYmE5ZjRkNDIyNjRlNTk5NA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NWFjMDhmMGZkZTFhM2MxZGJlMzUyN2I1YTFlZTU3NDBlMjJiMjVjZWMxOWRm
|
10
|
+
YTUyMmI2ODA4OTA4MzJlMDY5ZmViYWQwMDE2NTFmN2E4ODliOWRiN2RiMWE1
|
11
|
+
MDliNmJjYTM0MDM5ODU4NzMyMWFlMThkNDExOTE4YTZjOTE5NDI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MTlhYWU4ZDk4NzY0MWFiMDllMDY4MjU3NGZmZWQ0YTlmNGZjZTkzM2VhZTk2
|
14
|
+
MjY0ODYxZDY4ODRlMDY2Njk2M2RlNzc1MTNiYjQ0YWY2MmZhZGJkM2IxZTY5
|
15
|
+
MzAyN2U3NDg3NzBhNzEzYjdmMGEwOWZkOTcwZWQ5M2YwZDk4MGM=
|
data/CHANGES
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
== 0.9.4 - 4-Mar-2014
|
2
|
+
* Added support for AIX 5.3 or later courtesy of Rick Ohnemus.
|
3
|
+
* The Solaris version now uses FFI structs instead of a packed array.
|
4
|
+
It solved issues with 64-bit versions of Ruby and it's self-documenting.
|
5
|
+
* The FreeBSD version has been converted to use FFI. In addition, additional
|
6
|
+
struct members have been added, and members that previously returned nil
|
7
|
+
now return meaningful data.
|
8
|
+
* Support for NetBSD and OpenBSD has been temporarily dropped. Considering
|
9
|
+
that the C code did not build on those platforms anyway, I doubt most of
|
10
|
+
you will notice. Patches for those platforms are welcome, but only using FFI.
|
11
|
+
|
1
12
|
== 0.9.3 - 17-Mar-2013
|
2
13
|
* Fixed a bug on OSX where a long command string arg could cause
|
3
14
|
a segfault. Thanks go to Nathaniel Bibler for the spot.
|
data/MANIFEST
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
* Rakefile
|
4
4
|
* README
|
5
5
|
* sys-proctable.gemspec
|
6
|
+
* doc/aix.txt
|
6
7
|
* doc/bsd.txt
|
7
8
|
* doc/hpux.txt
|
8
9
|
* doc/linux.txt
|
@@ -10,20 +11,21 @@
|
|
10
11
|
* doc/top.txt
|
11
12
|
* doc/windows.txt
|
12
13
|
* example/example_ps.rb
|
13
|
-
* ext/bsd/extconf.rb
|
14
|
-
* ext/bsd/sys/proctable.c
|
15
14
|
* ext/darwin/extconf.rb
|
16
15
|
* ext/darwin/sys/proctable.c
|
17
16
|
* ext/hpux/extconf.rb
|
18
17
|
* ext/hpux/sys/proctable.c
|
19
18
|
* lib/sys/top.rb
|
19
|
+
* lib/aix/sys/proctable.rb
|
20
|
+
* lib/freebsd/sys/proctable.rb
|
20
21
|
* lib/linux/sys/proctable.rb
|
21
22
|
* lib/sunos/sys/proctable.rb
|
22
23
|
* lib/windows/sys/proctable.rb
|
24
|
+
* test/test_sys_proctable_aix.rb
|
23
25
|
* test/test_sys_proctable_all.rb
|
24
26
|
* test/test_sys_proctable_darwin.rb
|
27
|
+
* test/test_sys_proctable_freebsd.rb
|
25
28
|
* test/test_sys_proctable_hpux.rb
|
26
|
-
* test/test_sys_proctable_bsd.rb
|
27
29
|
* test/test_sys_proctable_linux.rb
|
28
30
|
* test/test_sys_proctable_sunos.rb
|
29
31
|
* test/test_sys_proctable_windows.rb
|
data/README
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
== Supported Platforms
|
8
8
|
* Windows 2000 or later
|
9
9
|
* Linux 2.6+
|
10
|
-
*
|
10
|
+
* FreeBSD
|
11
11
|
* Solaris 8+
|
12
12
|
* HP-UX 10+
|
13
13
|
* OS X 10.4+
|
@@ -20,7 +20,7 @@
|
|
20
20
|
gem install sys-proctable --platform mswin32 # Windows
|
21
21
|
gem install sys-proctable --platform sunos # Solaris
|
22
22
|
gem install sys-proctable --platform linux # Linux
|
23
|
-
gem install sys-proctable --platform freebsd #
|
23
|
+
gem install sys-proctable --platform freebsd # FreeBSD
|
24
24
|
|
25
25
|
== Synopsis
|
26
26
|
require 'sys/proctable'
|
@@ -51,7 +51,7 @@
|
|
51
51
|
information from a different host. This relies on the WMI service running.
|
52
52
|
|
53
53
|
== Known Issues
|
54
|
-
===
|
54
|
+
=== FreeBSD
|
55
55
|
A kvm interface is used. That means the owner of the process using the
|
56
56
|
sys-proctable library needs to be a member of the kvm group (or root).
|
57
57
|
|
@@ -67,13 +67,12 @@
|
|
67
67
|
Using readdir_r() still won't solve all potential thread safety issues anyway.
|
68
68
|
|
69
69
|
== Future Plans
|
70
|
-
|
71
|
-
|
72
|
-
release.
|
70
|
+
Add support for NetBSD and OpenBSD.
|
71
|
+
Convert existing C code to FFI.
|
73
72
|
|
74
73
|
== Acknowledgements
|
75
|
-
This library
|
76
|
-
Dan Urist. Many ideas, as well as large chunks of code, were taken
|
74
|
+
This library was originally based on the Perl module Proc::ProcessTable
|
75
|
+
by Dan Urist. Many ideas, as well as large chunks of code, were taken
|
77
76
|
from his work. So, a big THANK YOU goes out to Dan Urist.
|
78
77
|
|
79
78
|
A big thanks also goes out to Mike Hall who was very helpful with ideas,
|
@@ -105,7 +104,7 @@
|
|
105
104
|
Artistic 2.0
|
106
105
|
|
107
106
|
== Copyright
|
108
|
-
(C) 2003-
|
107
|
+
(C) 2003-2014 Daniel J. Berger
|
109
108
|
All Rights Reserved.
|
110
109
|
|
111
110
|
== Author
|
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ CLEAN.include(
|
|
8
8
|
'**/*.core', # Core dump files
|
9
9
|
'**/*.gem', # Gem files
|
10
10
|
'**/*.rbc', # Rubinius
|
11
|
-
'
|
11
|
+
'**/*.rbx', # Rubinius
|
12
12
|
'**/*.o', # C object file
|
13
13
|
'**/*.log', # Ruby extension build log
|
14
14
|
'**/Makefile', # C Makefile
|
@@ -27,9 +27,6 @@ task :build => [:clean] do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
case CONFIG['host_os']
|
30
|
-
when /bsd/i
|
31
|
-
dir = 'ext/bsd'
|
32
|
-
ext = '.so'
|
33
30
|
when /darwin/i
|
34
31
|
dir = 'ext/darwin'
|
35
32
|
ext = '.bundle'
|
@@ -38,7 +35,7 @@ task :build => [:clean] do
|
|
38
35
|
ext = '.sl'
|
39
36
|
end
|
40
37
|
|
41
|
-
|
38
|
+
if CONFIG['host_os'] =~ /darwin|hpux/i
|
42
39
|
Dir.chdir(dir) do
|
43
40
|
ruby 'extconf.rb'
|
44
41
|
sh 'make'
|
@@ -61,8 +58,10 @@ task :install => [:build] do
|
|
61
58
|
file = 'lib/linux/sys/proctable.rb'
|
62
59
|
when /sunos|solaris/i
|
63
60
|
file = 'lib/sunos/sys/proctable.rb'
|
64
|
-
when /
|
65
|
-
|
61
|
+
when /aix/i
|
62
|
+
file = 'lib/aix/sys/proctable.rb'
|
63
|
+
when /freebsd/i
|
64
|
+
file = 'lib/freebsd/sys/proctable.rb'
|
66
65
|
when /darwin/i
|
67
66
|
Dir.chdir('ext/darwin'){ sh 'make install' }
|
68
67
|
when /hpux/i
|
@@ -75,12 +74,12 @@ end
|
|
75
74
|
desc 'Uninstall the sys-proctable library'
|
76
75
|
task :uninstall do
|
77
76
|
case CONFIG['host_os']
|
78
|
-
when /
|
79
|
-
dir = File.join(CONFIG['sitelibdir'], 'sys')
|
80
|
-
file = File.join(dir, 'proctable.rb')
|
81
|
-
else
|
77
|
+
when /darwin|hpux/i
|
82
78
|
dir = File.join(CONFIG['sitearchdir'], 'sys')
|
83
79
|
file = File.join(dir, 'proctable.' + CONFIG['DLEXT'])
|
80
|
+
else
|
81
|
+
dir = File.join(CONFIG['sitelibdir'], 'sys')
|
82
|
+
file = File.join(dir, 'proctable.rb')
|
84
83
|
end
|
85
84
|
|
86
85
|
rm(file)
|
@@ -111,12 +110,15 @@ Rake::TestTask.new do |t|
|
|
111
110
|
when /sunos|solaris/i
|
112
111
|
t.test_files = FileList['test/test_sys_proctable_sunos.rb']
|
113
112
|
t.libs << 'lib/sunos'
|
113
|
+
when /aix/i
|
114
|
+
t.test_files = FileList['test/test_sys_proctable_aix.rb']
|
115
|
+
t.libs << 'lib/aix'
|
116
|
+
when /freebsd/i
|
117
|
+
t.test_files = FileList['test/test_sys_proctable_freebsd.rb']
|
118
|
+
t.libs << 'lib/freebsd'
|
114
119
|
when /darwin/i
|
115
120
|
t.libs << 'ext/darwin'
|
116
121
|
t.test_files = FileList['test/test_sys_proctable_darwin.rb']
|
117
|
-
when /bsd/i
|
118
|
-
t.libs << 'ext/bsd'
|
119
|
-
t.test_files = FileList['test/test_sys_proctable_bsd.rb']
|
120
122
|
when /hpux/i
|
121
123
|
t.libs << 'ext/hpux'
|
122
124
|
t.test_files = FileList['test/test_sys_proctable_hpux.rb']
|
@@ -133,13 +135,12 @@ namespace :gem do
|
|
133
135
|
# of some bugginess in Rubygems' platform.rb.
|
134
136
|
#
|
135
137
|
case CONFIG['host_os']
|
136
|
-
when /
|
138
|
+
when /freebsd/i
|
137
139
|
spec.platform = Gem::Platform.new(['universal', 'freebsd'])
|
138
|
-
spec.
|
139
|
-
spec.files
|
140
|
-
spec.
|
141
|
-
spec.
|
142
|
-
spec.extensions = ['ext/bsd/extconf.rb']
|
140
|
+
spec.require_paths = ['lib', 'lib/freebsd']
|
141
|
+
spec.files += ['lib/freebsd/sys/proctable.rb']
|
142
|
+
spec.test_files << 'test/test_sys_proctable_freebsd.rb'
|
143
|
+
spec.add_dependency('ffi')
|
143
144
|
when /darwin/i
|
144
145
|
spec.platform = Gem::Platform.new(['universal', 'darwin'])
|
145
146
|
spec.files << 'ext/darwin/sys/proctable.c'
|
@@ -162,6 +163,11 @@ namespace :gem do
|
|
162
163
|
spec.require_paths = ['lib', 'lib/sunos']
|
163
164
|
spec.files += ['lib/sunos/sys/proctable.rb']
|
164
165
|
spec.test_files << 'test/test_sys_proctable_sunos.rb'
|
166
|
+
when /aix/i
|
167
|
+
spec.platform = Gem::Platform.new(['universal', 'aix5'])
|
168
|
+
spec.require_paths = ['lib', 'lib/aix']
|
169
|
+
spec.files += ['lib/aix/sys/proctable.rb']
|
170
|
+
spec.test_files << 'test/test_sys_proctable_aix.rb'
|
165
171
|
when /mswin|win32|dos|cygwin|mingw|windows/i
|
166
172
|
spec.platform = Gem::Platform.new(['universal', 'mingw32'])
|
167
173
|
spec.require_paths = ['lib', 'lib/windows']
|
@@ -172,7 +178,12 @@ namespace :gem do
|
|
172
178
|
# https://github.com/rubygems/rubygems/issues/147
|
173
179
|
spec.original_platform = spec.platform
|
174
180
|
|
175
|
-
Gem::
|
181
|
+
if Gem::VERSION < "2.0"
|
182
|
+
Gem::Builder.new(spec).build
|
183
|
+
else
|
184
|
+
require 'rubygems/package'
|
185
|
+
Gem::Package.build(spec)
|
186
|
+
end
|
176
187
|
end
|
177
188
|
|
178
189
|
desc 'Install the sys-proctable library as a gem'
|
data/lib/sys/top.rb
CHANGED
@@ -7,19 +7,21 @@ module Sys
|
|
7
7
|
class Top
|
8
8
|
|
9
9
|
# The version of the sys-top library
|
10
|
-
VERSION = '1.0.
|
10
|
+
VERSION = '1.0.4'
|
11
11
|
|
12
12
|
# Returns an array of Struct::ProcTableStruct elements containing up
|
13
13
|
# to +num+ elements, sorted by +field+. The default number of elements
|
14
14
|
# is 10, while the default field is 'pctcpu'.
|
15
15
|
#
|
16
|
-
# Exception: the default sort field is 'pid' on
|
16
|
+
# Exception: the default sort field is 'pid' on AIX and Windows.
|
17
17
|
#
|
18
18
|
def self.top(num=10, field='pctcpu')
|
19
19
|
field = field.to_s if field.is_a?(Symbol)
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
aix = RbConfig::CONFIG['host_os'] =~ /aix/i
|
22
|
+
|
23
|
+
# Sort by pid on Windows and AIX by default
|
24
|
+
if (File::ALT_SEPARATOR || aix) && field == 'pctcpu'
|
23
25
|
field = 'pid'
|
24
26
|
end
|
25
27
|
|
@@ -15,7 +15,7 @@ module Sys
|
|
15
15
|
class Error < StandardError; end
|
16
16
|
|
17
17
|
# The version of the sys-proctable library
|
18
|
-
VERSION = '0.9.
|
18
|
+
VERSION = '0.9.4'
|
19
19
|
|
20
20
|
# The comm field corresponds to the 'name' field. The 'cmdline' field
|
21
21
|
# is the CommandLine attribute on Windows XP or later, or the
|
data/sys-proctable.gemspec
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'sys-proctable'
|
5
|
-
spec.version = '0.9.
|
5
|
+
spec.version = '0.9.4'
|
6
6
|
spec.author = 'Daniel J. Berger'
|
7
7
|
spec.license = 'Artistic 2.0'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
@@ -26,7 +26,8 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.rubyforge_project = 'sysutils'
|
27
27
|
spec.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST', 'doc/top.txt']
|
28
28
|
|
29
|
-
spec.add_development_dependency('test-unit'
|
29
|
+
spec.add_development_dependency('test-unit')
|
30
|
+
spec.add_development_dependency('rake')
|
30
31
|
|
31
32
|
spec.description = <<-EOF
|
32
33
|
The sys-proctable library provides an interface for gathering information
|
@@ -4,10 +4,7 @@
|
|
4
4
|
# Test suite for methods common to all platforms. Generally speaking
|
5
5
|
# you should run this test case using the 'rake test' task.
|
6
6
|
#######################################################################
|
7
|
-
require '
|
8
|
-
gem 'test-unit'
|
9
|
-
|
10
|
-
require 'test/unit'
|
7
|
+
require 'test-unit'
|
11
8
|
require 'sys/proctable'
|
12
9
|
require 'test/test_sys_top'
|
13
10
|
include Sys
|
@@ -22,7 +19,7 @@ class TC_ProcTable_All < Test::Unit::TestCase
|
|
22
19
|
end
|
23
20
|
|
24
21
|
def test_version
|
25
|
-
assert_equal('0.9.
|
22
|
+
assert_equal('0.9.4', ProcTable::VERSION)
|
26
23
|
end
|
27
24
|
|
28
25
|
def test_fields
|
metadata
CHANGED
@@ -1,32 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-proctable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
5
|
-
prerelease:
|
4
|
+
version: 0.9.4
|
6
5
|
platform: universal-mingw32
|
7
6
|
authors:
|
8
7
|
- Daniel J. Berger
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-03-04 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: test-unit
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
30
41
|
description: ! " The sys-proctable library provides an interface for gathering
|
31
42
|
information\n about processes on your system, i.e. the process table. Most major\n
|
32
43
|
\ platforms are supported and, while different platforms may return\n different
|
@@ -55,28 +66,27 @@ files:
|
|
55
66
|
homepage: http://www.rubyforge.org/projects/sysutils
|
56
67
|
licenses:
|
57
68
|
- Artistic 2.0
|
69
|
+
metadata: {}
|
58
70
|
post_install_message:
|
59
71
|
rdoc_options: []
|
60
72
|
require_paths:
|
61
73
|
- lib
|
62
74
|
- lib/windows
|
63
75
|
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
-
none: false
|
65
76
|
requirements:
|
66
77
|
- - ! '>='
|
67
78
|
- !ruby/object:Gem::Version
|
68
79
|
version: '0'
|
69
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
-
none: false
|
71
81
|
requirements:
|
72
82
|
- - ! '>='
|
73
83
|
- !ruby/object:Gem::Version
|
74
84
|
version: '0'
|
75
85
|
requirements: []
|
76
86
|
rubyforge_project: sysutils
|
77
|
-
rubygems_version:
|
87
|
+
rubygems_version: 2.0.3
|
78
88
|
signing_key:
|
79
|
-
specification_version:
|
89
|
+
specification_version: 4
|
80
90
|
summary: An interface for providing process table information
|
81
91
|
test_files:
|
82
92
|
- test/test_sys_proctable_all.rb
|