sys-proctable 0.7.4-mswin32 → 0.7.5-mswin32

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.7.5 - 23-Nov-2006
2
+ * Fixed int/long issues for Linux. Thanks go to Matt Lightner for the spot.
3
+ * Minor documentation fixes and changes to the extconf.rb file.
4
+
1
5
  == 0.7.4 - 20-Nov-2006
2
6
  * Added a patch that deals with the large file compilation issue on Solaris.
3
7
  You no longer need to build Ruby with --disable-largefile, or build a
@@ -20,7 +24,7 @@
20
24
  * Include bsd.c in tarball (oops).
21
25
  * Minor test updates for FreeBSD.
22
26
  * The 'pct_cpu' member for the BSD/kvm version has been changed to 'pctcpu'
23
- consistency with other platforms.
27
+ for consistency with other platforms.
24
28
 
25
29
  == 0.7.1 - 8-May-2005
26
30
  * Bug fixed for the cmdline info on Linux. Thanks go to Arash Abedinzadeh
data/doc/freebsd.txt CHANGED
@@ -38,7 +38,7 @@ VERSION
38
38
 
39
39
  = Class Methods
40
40
  ProcTable.fields
41
- Returns a list of fields available on the current OS. Also takes a block.
41
+ Returns an array of fields available on the current OS.
42
42
 
43
43
  ProcTable.ps(pid = nil)
44
44
  ProcTable.ps{ |s| ... }
data/doc/hpux.txt CHANGED
@@ -30,8 +30,7 @@ VERSION
30
30
 
31
31
  = Class Methods
32
32
  ProcTable.fields
33
- Returns a list of fields available on the current OS. May also take
34
- a block.
33
+ Returns an array of fields available on the current OS.
35
34
 
36
35
  ProcTable.ps(pid=nil)
37
36
  ProcTable.ps{ |s| ... }
data/doc/linux.txt CHANGED
@@ -38,8 +38,7 @@ VERSION
38
38
 
39
39
  = Class Methods
40
40
  ProcTable.fields
41
- Returns a list of fields available on the current OS. May also take a
42
- block.
41
+ Returns an array of fields available on the current OS.
43
42
 
44
43
  ProcTable.ps(pid=nil)
45
44
  ProcTable.ps{ |s| ... }
data/doc/solaris.txt CHANGED
@@ -36,8 +36,7 @@ VERSION
36
36
 
37
37
  = Class Methods
38
38
  ProcTable.fields
39
- Returns a list of fields available on the current OS. May also take
40
- a block.
39
+ Returns an array of fields available on the current OS.
41
40
 
42
41
  ProcTable.ps(pid=nil)
43
42
  ProcTable.ps{ |s| ... }
data/lib/sys/proctable.rb CHANGED
@@ -5,7 +5,7 @@ require 'parsedate'
5
5
  module Sys
6
6
  class ProcTableError < StandardError; end
7
7
  class ProcTable
8
- VERSION = '0.7.4'
8
+ VERSION = '0.7.5'
9
9
 
10
10
  ########################################################################
11
11
  # The comm field corresponds to the 'name' field. The 'cmdline' field
data/test/tc_all.rb CHANGED
@@ -6,12 +6,12 @@
6
6
  base = File.basename(Dir.pwd)
7
7
 
8
8
  if base == 'test' || base =~ /sys-proctable.*/
9
- require 'fileutils'
10
9
  Dir.chdir '..' if base == 'test'
11
10
 
12
11
  if RUBY_PLATFORM.match('mswin')
13
- File.rename('lib/sys/windows.rb', 'lib/sys/proctable.rb')
12
+ File.rename('lib/sys/windows.rb', 'lib/sys/proctable.rb') rescue nil
14
13
  else
14
+ require 'fileutils'
15
15
  require 'rbconfig'
16
16
  file = 'ext/proctable.' + Config::CONFIG['DLEXT']
17
17
  Dir.mkdir('sys') unless File.exists?('sys')
@@ -22,14 +22,18 @@ if base == 'test' || base =~ /sys-proctable.*/
22
22
  $LOAD_PATH.unshift(Dir.pwd + '/lib')
23
23
  end
24
24
 
25
- require 'sys/proctable'
25
+ require 'socket'
26
26
  require 'test/unit'
27
+ require 'sys/proctable'
27
28
  include Sys
28
29
 
29
30
  class TC_ProcTable_All < Test::Unit::TestCase
31
+ def setup
32
+ @host = Socket.gethostname
33
+ end
30
34
 
31
35
  def test_version
32
- assert_equal('0.7.4', ProcTable::VERSION)
36
+ assert_equal('0.7.5', ProcTable::VERSION)
33
37
  end
34
38
 
35
39
  def test_fields
@@ -48,18 +52,19 @@ class TC_ProcTable_All < Test::Unit::TestCase
48
52
  def test_ps_with_args
49
53
  assert_nothing_raised{ ProcTable.ps(0) }
50
54
  assert_nothing_raised{ ProcTable.ps(nil) }
55
+ assert_nothing_raised{ ProcTable.ps(0, @host) }
51
56
  assert_raises(TypeError){ ProcTable.ps('vim') }
52
- assert_raises(ArgumentError){ ProcTable.ps(0,1) }
57
+ assert_raises(ArgumentError){ ProcTable.ps(0, @host, 1) }
53
58
  end
54
59
 
55
60
  def test_ps_return_values
56
61
  assert_kind_of(Array, ProcTable.ps)
57
- assert_kind_of(Struct::ProcTableStruct, ProcTable.ps(1))
62
+ assert_kind_of(Struct::ProcTableStruct, ProcTable.ps(0))
58
63
  assert_equal(nil, ProcTable.ps(999999999))
59
64
  assert_equal(nil, ProcTable.ps{})
60
65
  end
61
-
62
- alias :set_up :setup
63
- alias :tear_down :teardown
64
-
66
+
67
+ def teardown
68
+ @host = nil
69
+ end
65
70
  end
data/test/tc_linux.rb CHANGED
@@ -9,7 +9,7 @@ if base == 'test' || base =~ /sys-proctable.*/
9
9
  require 'fileutils'
10
10
  require 'rbconfig'
11
11
 
12
- Dir.chdir '..' if base == 'test'
12
+ Dir.chdir('..') if base == 'test'
13
13
  file = 'ext/proctable.' + Config::CONFIG['DLEXT']
14
14
  Dir.mkdir('sys') unless File.exists?('sys')
15
15
  FileUtils.cp(file, 'sys')
@@ -17,10 +17,7 @@ if base == 'test' || base =~ /sys-proctable.*/
17
17
  $LOAD_PATH.unshift(Dir.pwd)
18
18
  end
19
19
 
20
- require "sys/proctable"
21
- require "test/unit"
22
20
  require "test/tc_all"
23
- include Sys
24
21
 
25
22
  class TC_ProcTable_Linux < Test::Unit::TestCase
26
23
 
data/test/tc_top.rb CHANGED
@@ -6,15 +6,13 @@
6
6
  base = File.basename(Dir.pwd)
7
7
 
8
8
  if base == 'test' || base =~ /sys-proctable.*/
9
- require 'fileutils'
10
9
  Dir.chdir('..') if base == 'test'
11
- Dir.mkdir('sys') unless File.exists?('sys')
12
- FileUtils.cp('lib/top.rb', 'sys')
13
- $LOAD_PATH.unshift Dir.pwd
10
+ $LOAD_PATH.unshift(Dir.pwd)
11
+ $LOAD_PATH.unshift(Dir.pwd + '/lib')
14
12
  end
15
13
 
16
- require 'sys/top'
17
14
  require 'test/unit'
15
+ require 'sys/top'
18
16
  include Sys
19
17
 
20
18
  class TC_Top < Test::Unit::TestCase
data/test/tc_windows.rb CHANGED
@@ -7,14 +7,11 @@ base = File.basename(Dir.pwd)
7
7
 
8
8
  if base == 'test' || base =~ /sys-proctable.*/
9
9
  Dir.chdir('..') if base == 'test'
10
- File.rename("lib/sys/windows.rb", "lib/sys/proctable.rb")
10
+ File.rename("lib/sys/windows.rb", "lib/sys/proctable.rb") rescue nil
11
11
  $LOAD_PATH.unshift(Dir.pwd + '/lib')
12
12
  end
13
13
 
14
- require 'sys/proctable'
15
- require 'test/unit'
16
14
  require 'test/tc_all'
17
- include Sys
18
15
 
19
16
  class TC_ProcTable_MSWindows < Test::Unit::TestCase
20
17
  def setup
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: sys-proctable
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.7.4
7
- date: 2006-11-21 00:00:00 -07:00
6
+ version: 0.7.5
7
+ date: 2006-11-23 00:00:00 -07:00
8
8
  summary: An interface for providing process table information
9
9
  require_paths:
10
10
  - lib