sys-proctable 0.9.1-universal-freebsd → 0.9.2-universal-freebsd
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +8 -0
- data/README +3 -11
- data/Rakefile +19 -21
- data/ext/bsd/sys/proctable.c +1 -1
- data/lib/sys/top.rb +1 -4
- data/sys-proctable.gemspec +2 -3
- data/test/test_sys_proctable_all.rb +2 -3
- metadata +8 -8
data/CHANGES
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 0.9.2 - 8-Oct-2012
|
2
|
+
* Added cmdline support for OS X. Thanks go to Matthias Zirnstein for
|
3
|
+
the patch.
|
4
|
+
* Warning cleanup for 1.9.
|
5
|
+
* Updated the gem platform handling. Replaced the borked string approach
|
6
|
+
with a two element array for Gem::Platform.new.
|
7
|
+
* MS date strings are now parse with DateTime instead of Date.
|
8
|
+
|
1
9
|
== 0.9.1 - 3-Aug-2011
|
2
10
|
* Added the pctcpu and pctmem members for Linux.
|
3
11
|
* Added Errno::ESRCH to a rescue clause on Linux that fixed a bug
|
data/README
CHANGED
@@ -59,15 +59,6 @@
|
|
59
59
|
The cmdline member on Solaris is limited to 80 characters unless you (or
|
60
60
|
your program) own the process. This is a Solaris design flaw/feature.
|
61
61
|
|
62
|
-
=== OS X
|
63
|
-
At the moment you do not get the full command line string. The code required
|
64
|
-
to get this information is obnoxious and I don't have any compelling desire
|
65
|
-
to add it. However, if you're willing to submit a patch I'll accept it.
|
66
|
-
|
67
|
-
You can find a good starting point with the OS X code found in Dan Urist's
|
68
|
-
Proc::ProcessTable module. You can find that module on CPAN. Point your
|
69
|
-
browser at http://search.cpan.org.
|
70
|
-
|
71
62
|
=== Thread Safety
|
72
63
|
I am not currently using a thread-safe version of readdir() for versions
|
73
64
|
of this library that use C. I am not especially concerned about it either.
|
@@ -95,7 +86,8 @@
|
|
95
86
|
euid, gid and guid info in the Linux version, along with some general
|
96
87
|
debugging help.
|
97
88
|
|
98
|
-
Thanks go to David Felstead for the original OS X code.
|
89
|
+
Thanks go to David Felstead for the original OS X code. Thanks also go
|
90
|
+
to Matthias Zirnstein for adding cmdline support for OS X.
|
99
91
|
|
100
92
|
Finally I'd like to thank all the folks who have submitted bug reports
|
101
93
|
and/or patches.
|
@@ -113,7 +105,7 @@
|
|
113
105
|
Artistic 2.0
|
114
106
|
|
115
107
|
== Copyright
|
116
|
-
(C) 2003-
|
108
|
+
(C) 2003-2012 Daniel J. Berger
|
117
109
|
All Rights Reserved.
|
118
110
|
|
119
111
|
== Author
|
data/Rakefile
CHANGED
@@ -2,12 +2,13 @@ require 'rake'
|
|
2
2
|
require 'rake/clean'
|
3
3
|
require 'rake/testtask'
|
4
4
|
require 'rbconfig'
|
5
|
-
include
|
5
|
+
include RbConfig
|
6
6
|
|
7
7
|
CLEAN.include(
|
8
8
|
'**/*.core', # Core dump files
|
9
9
|
'**/*.gem', # Gem files
|
10
10
|
'**/*.rbc', # Rubinius
|
11
|
+
'.rbx', '**/*/.rbx', # Rubinius
|
11
12
|
'**/*.o', # C object file
|
12
13
|
'**/*.log', # Ruby extension build log
|
13
14
|
'**/Makefile', # C Makefile
|
@@ -17,7 +18,7 @@ CLEAN.include(
|
|
17
18
|
|
18
19
|
desc 'Build the sys-proctable library for C versions of sys-proctable'
|
19
20
|
task :build => [:clean] do
|
20
|
-
case
|
21
|
+
case CONFIG['host_os']
|
21
22
|
when /bsd/i
|
22
23
|
dir = 'ext/bsd'
|
23
24
|
when /darwin/i
|
@@ -26,11 +27,11 @@ task :build => [:clean] do
|
|
26
27
|
dir = 'ext/hpux'
|
27
28
|
end
|
28
29
|
|
29
|
-
unless
|
30
|
+
unless CONFIG['host_os'] =~ /win32|mswin|dos|cygwin|mingw|windows|linux|sunos|solaris/i
|
30
31
|
Dir.chdir(dir) do
|
31
32
|
ruby 'extconf.rb'
|
32
33
|
sh 'make'
|
33
|
-
cp 'proctable.' +
|
34
|
+
cp 'proctable.' + CONFIG['DLEXT'], 'sys'
|
34
35
|
end
|
35
36
|
end
|
36
37
|
end
|
@@ -38,11 +39,11 @@ end
|
|
38
39
|
desc 'Install the sys-proctable library'
|
39
40
|
task :install => [:build] do
|
40
41
|
file = nil
|
41
|
-
dir = File.join(
|
42
|
+
dir = File.join(CONFIG['sitelibdir'], 'sys')
|
42
43
|
|
43
44
|
Dir.mkdir(dir) unless File.exists?(dir)
|
44
45
|
|
45
|
-
case
|
46
|
+
case CONFIG['host_os']
|
46
47
|
when /mswin|win32|msdos|cygwin|mingw|windows/i
|
47
48
|
file = 'lib/windows/sys/proctable.rb'
|
48
49
|
when /linux/i
|
@@ -62,13 +63,13 @@ end
|
|
62
63
|
|
63
64
|
desc 'Uninstall the sys-proctable library'
|
64
65
|
task :uninstall do
|
65
|
-
case
|
66
|
+
case CONFIG['host_os']
|
66
67
|
when /win32|mswin|dos|cygwin|mingw|windows|linux|sunos|solaris/i
|
67
|
-
dir = File.join(
|
68
|
+
dir = File.join(CONFIG['sitelibdir'], 'sys')
|
68
69
|
file = File.join(dir, 'proctable.rb')
|
69
70
|
else
|
70
|
-
dir = File.join(
|
71
|
-
file = File.join(dir, 'proctable.' +
|
71
|
+
dir = File.join(CONFIG['sitearchdir'], 'sys')
|
72
|
+
file = File.join(dir, 'proctable.' + CONFIG['DLEXT'])
|
72
73
|
end
|
73
74
|
|
74
75
|
rm(file)
|
@@ -89,7 +90,7 @@ Rake::TestTask.new do |t|
|
|
89
90
|
task :test => :build
|
90
91
|
t.libs << 'test' << '.'
|
91
92
|
|
92
|
-
case
|
93
|
+
case CONFIG['host_os']
|
93
94
|
when /mswin|msdos|cygwin|mingw|windows/i
|
94
95
|
t.test_files = FileList['test/test_sys_proctable_windows.rb']
|
95
96
|
t.libs << 'lib/windows'
|
@@ -120,41 +121,38 @@ namespace :gem do
|
|
120
121
|
# in order to get the universal platform settings I want because
|
121
122
|
# of some bugginess in Rubygems' platform.rb.
|
122
123
|
#
|
123
|
-
case
|
124
|
+
case CONFIG['host_os']
|
124
125
|
when /bsd/i
|
125
|
-
spec.platform = Gem::Platform.new('universal
|
126
|
+
spec.platform = Gem::Platform.new(['universal', 'freebsd'])
|
126
127
|
spec.platform.version = nil
|
127
128
|
spec.files << 'ext/bsd/sys/proctable.c'
|
128
129
|
spec.extra_rdoc_files << 'ext/bsd/sys/proctable.c'
|
129
130
|
spec.test_files << 'test/test_sys_proctable_bsd.rb'
|
130
131
|
spec.extensions = ['ext/bsd/extconf.rb']
|
131
132
|
when /darwin/i
|
132
|
-
spec.platform = Gem::Platform.new('universal
|
133
|
+
spec.platform = Gem::Platform.new(['universal', 'darwin'])
|
133
134
|
spec.files << 'ext/darwin/sys/proctable.c'
|
134
135
|
spec.extra_rdoc_files << 'ext/darwin/sys/proctable.c'
|
135
136
|
spec.test_files << 'test/test_sys_proctable_darwin.rb'
|
136
137
|
spec.extensions = ['ext/darwin/extconf.rb']
|
137
138
|
when /hpux/i
|
138
|
-
spec.platform = Gem::Platform.new('universal
|
139
|
+
spec.platform = Gem::Platform.new(['universal', 'hpux'])
|
139
140
|
spec.files << 'ext/hpux/sys/proctable.c'
|
140
141
|
spec.extra_rdoc_files << 'ext/hpux/sys/proctable.c'
|
141
142
|
spec.test_files << 'test/test_sys_proctable_hpux.rb'
|
142
143
|
spec.extensions = ['ext/hpux/extconf.rb']
|
143
144
|
when /linux/i
|
144
|
-
spec.platform = Gem::Platform.new('universal
|
145
|
+
spec.platform = Gem::Platform.new(['universal', 'linux'])
|
145
146
|
spec.require_paths = ['lib', 'lib/linux']
|
146
147
|
spec.files += ['lib/linux/sys/proctable.rb']
|
147
148
|
spec.test_files << 'test/test_sys_proctable_linux.rb'
|
148
149
|
when /sunos|solaris/i
|
149
|
-
spec.platform = Gem::Platform.new('universal
|
150
|
-
spec.platform.version = nil
|
150
|
+
spec.platform = Gem::Platform.new(['universal', 'solaris'])
|
151
151
|
spec.require_paths = ['lib', 'lib/sunos']
|
152
152
|
spec.files += ['lib/sunos/sys/proctable.rb']
|
153
153
|
spec.test_files << 'test/test_sys_proctable_sunos.rb'
|
154
154
|
when /mswin|win32|dos|cygwin|mingw|windows/i
|
155
|
-
spec.platform = Gem::Platform
|
156
|
-
spec.platform.cpu = 'universal'
|
157
|
-
spec.platform.version = nil
|
155
|
+
spec.platform = Gem::Platform.new(['universal', 'mingw'])
|
158
156
|
spec.require_paths = ['lib', 'lib/windows']
|
159
157
|
spec.files += ['lib/windows/sys/proctable.rb']
|
160
158
|
spec.test_files << 'test/test_sys_proctable_windows.rb'
|
data/ext/bsd/sys/proctable.c
CHANGED
data/lib/sys/top.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'sys/proctable'
|
2
|
-
require 'rbconfig'
|
3
2
|
|
4
3
|
# The Sys module serves as a namespace only
|
5
4
|
module Sys
|
@@ -19,10 +18,8 @@ module Sys
|
|
19
18
|
def self.top(num=10, field='pctcpu')
|
20
19
|
field = field.to_s if field.is_a?(Symbol)
|
21
20
|
|
22
|
-
windows = /mswin|win32|windows|dos|cygwin|mingw/i
|
23
|
-
|
24
21
|
# Sort by pid on Windows by default
|
25
|
-
if
|
22
|
+
if File::ALT_SEPARATOR && field == 'pctcpu'
|
26
23
|
field = 'pid'
|
27
24
|
end
|
28
25
|
|
data/sys-proctable.gemspec
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require 'rbconfig'
|
3
2
|
|
4
3
|
Gem::Specification.new do |spec|
|
5
4
|
spec.name = 'sys-proctable'
|
6
|
-
spec.version = '0.9.
|
5
|
+
spec.version = '0.9.2'
|
7
6
|
spec.author = 'Daniel J. Berger'
|
8
7
|
spec.license = 'Artistic 2.0'
|
9
8
|
spec.email = 'djberg96@gmail.com'
|
@@ -27,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
27
26
|
spec.rubyforge_project = 'sysutils'
|
28
27
|
spec.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST', 'doc/top.txt']
|
29
28
|
|
30
|
-
spec.add_development_dependency('test-unit', '>= 2.
|
29
|
+
spec.add_development_dependency('test-unit', '>= 2.4.0')
|
31
30
|
|
32
31
|
spec.description = <<-EOF
|
33
32
|
The sys-proctable library provides an interface for gathering information
|
@@ -9,13 +9,12 @@ gem 'test-unit'
|
|
9
9
|
|
10
10
|
require 'test/unit'
|
11
11
|
require 'sys/proctable'
|
12
|
-
require 'rbconfig'
|
13
12
|
require 'test/test_sys_top'
|
14
13
|
include Sys
|
15
14
|
|
16
15
|
class TC_ProcTable_All < Test::Unit::TestCase
|
17
16
|
def self.startup
|
18
|
-
@@windows =
|
17
|
+
@@windows = File::ALT_SEPARATOR
|
19
18
|
end
|
20
19
|
|
21
20
|
def setup
|
@@ -23,7 +22,7 @@ class TC_ProcTable_All < Test::Unit::TestCase
|
|
23
22
|
end
|
24
23
|
|
25
24
|
def test_version
|
26
|
-
assert_equal('0.9.
|
25
|
+
assert_equal('0.9.2', ProcTable::VERSION)
|
27
26
|
end
|
28
27
|
|
29
28
|
def test_fields
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-proctable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 2
|
10
|
+
version: 0.9.2
|
11
11
|
platform: universal-freebsd
|
12
12
|
authors:
|
13
13
|
- Daniel J. Berger
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-10-08 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: test-unit
|
@@ -25,12 +25,12 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 31
|
29
29
|
segments:
|
30
30
|
- 2
|
31
|
-
-
|
32
|
-
-
|
33
|
-
version: 2.
|
31
|
+
- 4
|
32
|
+
- 0
|
33
|
+
version: 2.4.0
|
34
34
|
type: :development
|
35
35
|
version_requirements: *id001
|
36
36
|
description: " The sys-proctable library provides an interface for gathering information\n about processes on your system, i.e. the process table. Most major\n platforms are supported and, while different platforms may return\n different information, the external interface is identical across\n platforms.\n"
|