sys-proctable 0.9.3-universal-darwin → 0.9.4-universal-darwin

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 11f52508143ac983c07b528b5622e940486a41f1
4
+ data.tar.gz: 1a897f239ba90adf065767ee4a58d3a3d2578dbf
5
+ SHA512:
6
+ metadata.gz: e3a8a5a456d03c9131dddb824159718832f77e3d41d21f344a5e3c2b41f002a165bf9a651b71f058aacb9edd795ba6a85fa29e9e5feaecb6fe25d2f5569a492a
7
+ data.tar.gz: bfef4c48d0089ffea5b5200c8a16aeaa2ab83437dcb3d5e7b4eed360241877a7eebc7735a0e78882f3aaff5e87359ed761c72fa5283833c0e2a43657fb3204ca
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
- * BSD (various flavors)
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 # BSD (any flavor)
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
- === BSD
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
- Research has indicated that the kvm approach is less favored than a sysctl
71
- approach on BSD variants. I will try to add this interface in a future
72
- release.
70
+ Add support for NetBSD and OpenBSD.
71
+ Convert existing C code to FFI.
73
72
 
74
73
  == Acknowledgements
75
- This library is largely based on the Perl module Proc::ProcessTable by
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-2012 Daniel J. Berger
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
- '.rbx', '**/*/.rbx', # Rubinius
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
- unless CONFIG['host_os'] =~ /win32|mswin|dos|cygwin|mingw|windows|linux|sunos|solaris/i
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 /bsd/i
65
- Dir.chdir('ext/bsd'){ sh 'make install' }
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 /win32|mswin|dos|cygwin|mingw|windows|linux|sunos|solaris/i
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 /bsd/i
138
+ when /freebsd/i
137
139
  spec.platform = Gem::Platform.new(['universal', 'freebsd'])
138
- spec.platform.version = nil
139
- spec.files << 'ext/bsd/sys/proctable.c'
140
- spec.extra_rdoc_files << 'ext/bsd/sys/proctable.c'
141
- spec.test_files << 'test/test_sys_proctable_bsd.rb'
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::Builder.new(spec).build
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'
@@ -20,7 +20,7 @@
20
20
 
21
21
  #define pid_of(pproc) pproc->kp_proc.p_pid
22
22
 
23
- #define SYS_PROCTABLE_VERSION "0.9.3"
23
+ #define SYS_PROCTABLE_VERSION "0.9.4"
24
24
 
25
25
  #define PROC_MIB_LEN 4
26
26
  #define ARGS_MIB_LEN 3
@@ -269,8 +269,8 @@ static VALUE pt_ps(int argc, VALUE* argv, VALUE klass){
269
269
  }*/
270
270
  char cmdline[ARGS_MAX_LEN+1];
271
271
 
272
- argv_of_pid(procs[i].kp_proc.p_pid, &cmdline);
273
- /* free(cmdline); */
272
+ argv_of_pid(procs[i].kp_proc.p_pid, cmdline);
273
+ // free(cmdline);
274
274
 
275
275
  // Get the start time of the process
276
276
  v_start_time = rb_time_new(
@@ -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.3'
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 Linux and Windows.
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
- # Sort by pid on Windows by default
22
- if File::ALT_SEPARATOR && field == 'pctcpu'
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
 
@@ -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.3'
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', '>= 2.4.0')
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 'rubygems'
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.3', ProcTable::VERSION)
22
+ assert_equal('0.9.4', ProcTable::VERSION)
26
23
  end
27
24
 
28
25
  def test_fields
@@ -4,9 +4,7 @@
4
4
  # Test suite for the Darwin version of the sys-proctable library. You
5
5
  # should run these tests via the 'rake test' task.
6
6
  ########################################################################
7
- require 'rubygems'
8
- gem 'test-unit'
9
-
7
+ require 'test-unit'
10
8
  require 'sys/proctable'
11
9
  require 'test/test_sys_proctable_all'
12
10
  include Sys
metadata CHANGED
@@ -1,36 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sys-proctable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
5
- prerelease:
4
+ version: 0.9.4
6
5
  platform: universal-darwin
7
6
  authors:
8
7
  - Daniel J. Berger
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-17 00:00:00.000000000 Z
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: 2.4.0
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: 2.4.0
30
- description: ! " The sys-proctable library provides an interface for gathering
31
- information\n about processes on your system, i.e. the process table. Most major\n
32
- \ platforms are supported and, while different platforms may return\n different
33
- information, the external interface is identical across\n platforms.\n"
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'
41
+ description: |2
42
+ The sys-proctable library provides an interface for gathering information
43
+ about processes on your system, i.e. the process table. Most major
44
+ platforms are supported and, while different platforms may return
45
+ different information, the external interface is identical across
46
+ platforms.
34
47
  email: djberg96@gmail.com
35
48
  executables: []
36
49
  extensions:
@@ -42,43 +55,42 @@ extra_rdoc_files:
42
55
  - doc/top.txt
43
56
  - ext/darwin/sys/proctable.c
44
57
  files:
45
- - benchmarks/bench_ps.rb
46
- - examples/example_ps.rb
47
- - lib/sys/top.rb
48
58
  - CHANGES
49
59
  - MANIFEST
50
- - Rakefile
51
60
  - README
52
- - sys-proctable.gemspec
53
- - test/test_sys_proctable_all.rb
61
+ - Rakefile
62
+ - benchmarks/bench_ps.rb
54
63
  - doc/top.txt
64
+ - examples/example_ps.rb
65
+ - ext/darwin/extconf.rb
55
66
  - ext/darwin/sys/proctable.c
67
+ - lib/sys/top.rb
68
+ - sys-proctable.gemspec
69
+ - test/test_sys_proctable_all.rb
56
70
  - test/test_sys_proctable_darwin.rb
57
- - ext/darwin/extconf.rb
58
71
  homepage: http://www.rubyforge.org/projects/sysutils
59
72
  licenses:
60
73
  - Artistic 2.0
74
+ metadata: {}
61
75
  post_install_message:
62
76
  rdoc_options: []
63
77
  require_paths:
64
78
  - lib
65
79
  required_ruby_version: !ruby/object:Gem::Requirement
66
- none: false
67
80
  requirements:
68
- - - ! '>='
81
+ - - ">="
69
82
  - !ruby/object:Gem::Version
70
83
  version: '0'
71
84
  required_rubygems_version: !ruby/object:Gem::Requirement
72
- none: false
73
85
  requirements:
74
- - - ! '>='
86
+ - - ">="
75
87
  - !ruby/object:Gem::Version
76
88
  version: '0'
77
89
  requirements: []
78
90
  rubyforge_project: sysutils
79
- rubygems_version: 1.8.23
91
+ rubygems_version: 2.2.2
80
92
  signing_key:
81
- specification_version: 3
93
+ specification_version: 4
82
94
  summary: An interface for providing process table information
83
95
  test_files:
84
96
  - test/test_sys_proctable_all.rb