sys-proctable 0.9.4-universal-freebsd → 0.9.5-universal-freebsd

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c45e6ae56c6571febf5b2b7038bcc643d3cb337
4
- data.tar.gz: f42dd07643ccc87be3ad289b8b0e9d3b2c7252cf
3
+ metadata.gz: a566ff5a016674fbb932b3654f3879b187c8ce72
4
+ data.tar.gz: 42ebbde6cbe341ae749e03d06998e742aa24935c
5
5
  SHA512:
6
- metadata.gz: 06e5a4dfbe1c74ca7fae99ceaad63adf7657fb789298fb7928f776c5684611b82927cca7b3abc4b1671771ea1383953c3f4ad91bcfb7a69cc8f2236612c6c46f
7
- data.tar.gz: 87253dd8de985d402bc83034083c603743e4ae6ac80121a4c6b5bdfb1b58d4c0ae483071fa60205b9038887b0425ed6fe06289b2af4ce85ec49e94314f40d3cb
6
+ metadata.gz: 26d63ad978ec55e167330d9c2e78d90f7af330e2aae78a2c5f8b731c248f38b5ac795844c4d68c07cb6c72f769d1bab5fc88e967dae5897316eb1969ef43cadb
7
+ data.tar.gz: 2f4cdafccd2defe758f3d8dc358b3c8cdfbde45be8fce99e15797ba64dae6861154f29c46ead693409f560d2325cc85e3b2ab3f04c599db76bdf589e0f727914
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.9.5 - 10-Feb-2015
2
+ * Significant cleanup and memory reduction of the OSX code. Thanks go
3
+ to Ivan (toy) for the patches.
4
+ * Skip over /proc/<file>/status if unreadable on Linux. Thanks go to Jianjun
5
+ Mao for the patch.
6
+
1
7
  == 0.9.4 - 4-Mar-2014
2
8
  * Added support for AIX 5.3 or later courtesy of Rick Ohnemus.
3
9
  * The Solaris version now uses FFI structs instead of a packed array.
data/Rakefile CHANGED
@@ -174,6 +174,8 @@ namespace :gem do
174
174
  spec.files += ['lib/windows/sys/proctable.rb']
175
175
  spec.test_files << 'test/test_sys_proctable_windows.rb'
176
176
  end
177
+
178
+ spec.test_files << 'test/test_sys_top.rb'
177
179
 
178
180
  # https://github.com/rubygems/rubygems/issues/147
179
181
  spec.original_platform = spec.platform
@@ -5,7 +5,7 @@ module Sys
5
5
  extend FFI::Library
6
6
 
7
7
  # The version of the sys-proctable library.
8
- VERSION = '0.9.4'
8
+ VERSION = '0.9.5'
9
9
 
10
10
  # Error typically raised if the ProcTable.ps method fails.
11
11
  class Error < StandardError; end
@@ -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.4'
5
+ spec.version = '0.9.5'
6
6
  spec.author = 'Daniel J. Berger'
7
7
  spec.license = 'Artistic 2.0'
8
8
  spec.email = 'djberg96@gmail.com'
@@ -19,7 +19,7 @@ class TC_ProcTable_All < Test::Unit::TestCase
19
19
  end
20
20
 
21
21
  def test_version
22
- assert_equal('0.9.4', ProcTable::VERSION)
22
+ assert_equal('0.9.5', ProcTable::VERSION)
23
23
  end
24
24
 
25
25
  def test_fields
@@ -71,6 +71,12 @@ class TC_ProcTable_All < Test::Unit::TestCase
71
71
  assert_kind_of(StandardError, Sys::ProcTable::Error.new)
72
72
  end
73
73
 
74
+ def test_from_thread
75
+ Thread.new do
76
+ Sys::ProcTable.ps
77
+ end.value
78
+ end
79
+
74
80
  def teardown
75
81
  @pid = nil
76
82
  end
@@ -0,0 +1,46 @@
1
+ ##############################################################################
2
+ # test_sys_top.rb
3
+ #
4
+ # Test suite for the sys-top library that is included with this distribution.
5
+ ##############################################################################
6
+ require 'rubygems'
7
+ gem 'test-unit'
8
+
9
+ require 'test/unit'
10
+ require 'sys/top'
11
+
12
+ class TC_Top < Test::Unit::TestCase
13
+ include Sys
14
+
15
+ def test_version
16
+ assert_equal('1.0.4', Top::VERSION)
17
+ end
18
+
19
+ def test_top_basic
20
+ assert_respond_to(Top, :top)
21
+ assert_nothing_raised{ Top.top }
22
+ assert_nothing_raised{ Top.top(5) }
23
+ assert_nothing_raised{ Top.top(5, 'cmdline') }
24
+ end
25
+
26
+ def test_top
27
+ assert_equal(10, Top.top.length)
28
+ assert_kind_of(Struct::ProcTableStruct, Top.top.first)
29
+ end
30
+
31
+ def test_top_with_size
32
+ assert_equal(5, Top.top(5).length)
33
+ end
34
+
35
+ def test_top_with_size_and_sort_by_field
36
+ assert_equal(5, Top.top(5, :cmdline).length)
37
+ end
38
+
39
+ def test_top_return_type
40
+ assert_kind_of(Array, Top.top)
41
+ end
42
+
43
+ def test_top_expected_errors
44
+ assert_raises(ArgumentError){ Top.top(1, 'foo', 2) }
45
+ end
46
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sys-proctable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: universal-freebsd
6
6
  authors:
7
7
  - Daniel J. Berger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-04 00:00:00.000000000 Z
11
+ date: 2015-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -79,6 +79,7 @@ files:
79
79
  - sys-proctable.gemspec
80
80
  - test/test_sys_proctable_all.rb
81
81
  - test/test_sys_proctable_freebsd.rb
82
+ - test/test_sys_top.rb
82
83
  homepage: http://www.rubyforge.org/projects/sysutils
83
84
  licenses:
84
85
  - Artistic 2.0
@@ -107,3 +108,4 @@ summary: An interface for providing process table information
107
108
  test_files:
108
109
  - test/test_sys_proctable_all.rb
109
110
  - test/test_sys_proctable_freebsd.rb
111
+ - test/test_sys_top.rb