sys-proctable 0.9.1-universal-linux → 0.9.2-universal-linux

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -20,6 +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
24
 
24
25
  == Synopsis
25
26
  require 'sys/proctable'
@@ -58,15 +59,6 @@
58
59
  The cmdline member on Solaris is limited to 80 characters unless you (or
59
60
  your program) own the process. This is a Solaris design flaw/feature.
60
61
 
61
- === OS X
62
- At the moment you do not get the full command line string. The code required
63
- to get this information is obnoxious and I don't have any compelling desire
64
- to add it. However, if you're willing to submit a patch I'll accept it.
65
-
66
- You can find a good starting point with the OS X code found in Dan Urist's
67
- Proc::ProcessTable module. You can find that module on CPAN. Point your
68
- browser at http://search.cpan.org.
69
-
70
62
  === Thread Safety
71
63
  I am not currently using a thread-safe version of readdir() for versions
72
64
  of this library that use C. I am not especially concerned about it either.
@@ -94,7 +86,8 @@
94
86
  euid, gid and guid info in the Linux version, along with some general
95
87
  debugging help.
96
88
 
97
- 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.
98
91
 
99
92
  Finally I'd like to thank all the folks who have submitted bug reports
100
93
  and/or patches.
@@ -112,7 +105,7 @@
112
105
  Artistic 2.0
113
106
 
114
107
  == Copyright
115
- (C) 2003-2010 Daniel J. Berger
108
+ (C) 2003-2012 Daniel J. Berger
116
109
  All Rights Reserved.
117
110
 
118
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 Config
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 Config::CONFIG['host_os']
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 Config::CONFIG['host_os'] =~ /win32|mswin|dos|cygwin|mingw|windows|linux|sunos|solaris/i
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.' + Config::CONFIG['DLEXT'], 'sys'
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(Config::CONFIG['sitelibdir'], 'sys')
42
+ dir = File.join(CONFIG['sitelibdir'], 'sys')
42
43
 
43
44
  Dir.mkdir(dir) unless File.exists?(dir)
44
45
 
45
- case Config::CONFIG['host_os']
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 Config::CONFIG['host_os']
66
+ case CONFIG['host_os']
66
67
  when /win32|mswin|dos|cygwin|mingw|windows|linux|sunos|solaris/i
67
- dir = File.join(Config::CONFIG['sitelibdir'], 'sys')
68
+ dir = File.join(CONFIG['sitelibdir'], 'sys')
68
69
  file = File.join(dir, 'proctable.rb')
69
70
  else
70
- dir = File.join(Config::CONFIG['sitearchdir'], 'sys')
71
- file = File.join(dir, 'proctable.' + Config::CONFIG['DLEXT'])
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 Config::CONFIG['host_os']
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,40 +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 Config::CONFIG['host_os']
124
+ case CONFIG['host_os']
124
125
  when /bsd/i
125
- spec.platform = Gem::Platform.new('universal-bsd')
126
+ spec.platform = Gem::Platform.new(['universal', 'freebsd'])
127
+ spec.platform.version = nil
126
128
  spec.files << 'ext/bsd/sys/proctable.c'
127
129
  spec.extra_rdoc_files << 'ext/bsd/sys/proctable.c'
128
130
  spec.test_files << 'test/test_sys_proctable_bsd.rb'
129
131
  spec.extensions = ['ext/bsd/extconf.rb']
130
132
  when /darwin/i
131
- spec.platform = Gem::Platform.new('universal-darwin')
133
+ spec.platform = Gem::Platform.new(['universal', 'darwin'])
132
134
  spec.files << 'ext/darwin/sys/proctable.c'
133
135
  spec.extra_rdoc_files << 'ext/darwin/sys/proctable.c'
134
136
  spec.test_files << 'test/test_sys_proctable_darwin.rb'
135
137
  spec.extensions = ['ext/darwin/extconf.rb']
136
138
  when /hpux/i
137
- spec.platform = Gem::Platform.new('universal-hpux')
139
+ spec.platform = Gem::Platform.new(['universal', 'hpux'])
138
140
  spec.files << 'ext/hpux/sys/proctable.c'
139
141
  spec.extra_rdoc_files << 'ext/hpux/sys/proctable.c'
140
142
  spec.test_files << 'test/test_sys_proctable_hpux.rb'
141
143
  spec.extensions = ['ext/hpux/extconf.rb']
142
144
  when /linux/i
143
- spec.platform = Gem::Platform.new('universal-linux')
145
+ spec.platform = Gem::Platform.new(['universal', 'linux'])
144
146
  spec.require_paths = ['lib', 'lib/linux']
145
147
  spec.files += ['lib/linux/sys/proctable.rb']
146
148
  spec.test_files << 'test/test_sys_proctable_linux.rb'
147
149
  when /sunos|solaris/i
148
- spec.platform = Gem::Platform.new('universal-solaris10.0')
149
- spec.platform.version = nil
150
+ spec.platform = Gem::Platform.new(['universal', 'solaris'])
150
151
  spec.require_paths = ['lib', 'lib/sunos']
151
152
  spec.files += ['lib/sunos/sys/proctable.rb']
152
153
  spec.test_files << 'test/test_sys_proctable_sunos.rb'
153
154
  when /mswin|win32|dos|cygwin|mingw|windows/i
154
- spec.platform = Gem::Platform::CURRENT
155
- spec.platform.cpu = 'universal'
156
- spec.platform.version = nil
155
+ spec.platform = Gem::Platform.new(['universal', 'mingw'])
157
156
  spec.require_paths = ['lib', 'lib/windows']
158
157
  spec.files += ['lib/windows/sys/proctable.rb']
159
158
  spec.test_files << 'test/test_sys_proctable_windows.rb'
@@ -11,7 +11,7 @@ module Sys
11
11
  private_class_method :new
12
12
 
13
13
  # The version of the sys-proctable library
14
- VERSION = '0.9.1'
14
+ VERSION = '0.9.2'
15
15
 
16
16
  private
17
17
 
@@ -134,7 +134,7 @@ module Sys
134
134
  key, value = str.split('=')
135
135
  struct.environ[key] = value
136
136
  }
137
- rescue Errno::EACCES, Errno::ESRCH
137
+ rescue Errno::EACCES, Errno::ESRCH, Errno::ENOENT
138
138
  # Ignore and move on.
139
139
  end
140
140
 
@@ -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 Config::CONFIG['host_os'].match(windows) && field == 'pctcpu'
22
+ if File::ALT_SEPARATOR && field == 'pctcpu'
26
23
  field = 'pid'
27
24
  end
28
25
 
@@ -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.1'
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.1.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 = Config::CONFIG['host_os'] =~ /windows|win32|msdos|mswin32|mingw|cygwin/i
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.1', ProcTable::VERSION)
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: 57
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 1
10
- version: 0.9.1
9
+ - 2
10
+ version: 0.9.2
11
11
  platform: universal-linux
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: 2011-08-20 00:00:00 Z
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: 15
28
+ hash: 31
29
29
  segments:
30
30
  - 2
31
- - 1
32
- - 2
33
- version: 2.1.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"
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  requirements: []
88
88
 
89
89
  rubyforge_project: sysutils
90
- rubygems_version: 1.8.8
90
+ rubygems_version: 1.8.17
91
91
  signing_key:
92
92
  specification_version: 3
93
93
  summary: An interface for providing process table information