win32-process 0.7.4 → 0.7.5

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: 39dc3aa30a05db65cfb45dff067edea0f839f5b5
4
- data.tar.gz: a13b9e2d70c63c9b532d87fe385386308e11301d
3
+ metadata.gz: 7abeeac7e3b746666569ab363e702c8939a4a596
4
+ data.tar.gz: 693447613255756de95668ddfefa702ecc5b9921
5
5
  SHA512:
6
- metadata.gz: 0ad9884c726af4c9efbdc2f32cb36540fdeb17355a69a155853720f66025d9b5b8e35263bb14c6da012003daa835813a0b3680e5854088124ff2140916401aec
7
- data.tar.gz: 6a30f65e1f17d01c59b09d602eb44783f7e959dda498f1630f877901d79ab4af48f073ce7578eb01a91e20c2d14c95c13757966444bf692133f5bc3db8fc48f3
6
+ metadata.gz: 2a7faa782828c7a8cbbf54f997ded9a3c97023b641417207e03938378520f0072b29e7fc1d11c26307e59c94ff975cdfdfebdbe9cbc0adedf2abe57a1251ecee
7
+ data.tar.gz: 9a1ba82a14f16365850fbc7e50787c3233fedd3d54307757202dd60d05a9f4057cc4e617d3ad7d97783861c4098ee82c6bfdb56a8d4210d6404aca1a0682e613
data/CHANGES CHANGED
@@ -1,3 +1,10 @@
1
+ = 0.7.5 - 3-Mar-2015
2
+ * Use require_relative where possible.
3
+ * Fixed a bug in Process.setrlimit. Note that this method has been marked
4
+ as experimental until further notice.
5
+ * Minor updates to gemspec and Rakefile.
6
+ * Added known issue for JRuby and SIGBRK to the README.
7
+
1
8
  = 0.7.4 - 21-Oct-2013
2
9
  * Fixed the INVALID_HANDLE_VALUE constant for 64-bit versions of Ruby.
3
10
  * Added Rake as a development dependency.
data/README CHANGED
@@ -55,15 +55,17 @@
55
55
  This was added at some point in the Ruby 1.9 dev cycle so it was removed
56
56
  from this library.
57
57
 
58
- = Known Bugs
59
- None known. Any bugs should be reported on the project page at
58
+ = Known Issues
59
+ JRuby doesn't seem to like SIGBRK for Process.kill.
60
+
61
+ Any issues or bugs should be reported on the project page at
60
62
  https://github.com/djberg96/win32-process.
61
63
 
62
64
  = License
63
65
  Artistic 2.0
64
66
 
65
67
  = Copyright
66
- (C) 2003-2013 Daniel J. Berger
68
+ (C) 2003-2015 Daniel J. Berger
67
69
  All Rights Reserved
68
70
 
69
71
  = Warranty
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ namespace :gem do
10
10
  desc 'Create the win32-process gem'
11
11
  task :create => [:clean] do
12
12
  spec = eval(IO.read('win32-process.gemspec'))
13
- if Gem::VERSION.to_f < 2.0
13
+ if Gem::VERSION < "2.0"
14
14
  Gem::Builder.new(spec).build
15
15
  else
16
16
  require 'rubygems/package'
@@ -21,7 +21,7 @@ namespace :gem do
21
21
  desc 'Install the win32-process gem'
22
22
  task :install => [:create] do
23
23
  file = Dir["*.gem"].first
24
- sh "gem install #{file}"
24
+ sh "gem install -l #{file}"
25
25
  end
26
26
  end
27
27
 
@@ -1,8 +1,7 @@
1
- require File.join(File.expand_path(File.dirname(__FILE__)), 'process', 'functions')
2
- require File.join(File.expand_path(File.dirname(__FILE__)), 'process', 'constants')
3
- require File.join(File.expand_path(File.dirname(__FILE__)), 'process', 'structs')
4
- require File.join(File.expand_path(File.dirname(__FILE__)), 'process', 'helper')
5
-
1
+ require_relative 'process/functions'
2
+ require_relative 'process/constants'
3
+ require_relative 'process/structs'
4
+ require_relative 'process/helper'
6
5
 
7
6
  module Process
8
7
  include Process::Constants
@@ -11,7 +10,7 @@ module Process
11
10
  extend Process::Constants
12
11
 
13
12
  # The version of the win32-process library.
14
- WIN32_PROCESS_VERSION = '0.7.4'
13
+ WIN32_PROCESS_VERSION = '0.7.5'
15
14
 
16
15
  # Disable popups. This mostly affects the Process.kill method.
17
16
  SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX)
@@ -333,6 +332,9 @@ module Process
333
332
  # Process.setrlimit(Process::RLIMIT_VMEM, 1024 * 4) # => nil
334
333
  # Process.getrlimit(Process::RLIMIT_VMEM) # => [4096, 4096]
335
334
  #
335
+ # WARNING: Exceeding the limit you set with this method could segfault
336
+ # the interpreter. Consider this method experimental.
337
+ #
336
338
  def setrlimit(resource, current_limit, max_limit = nil)
337
339
  max_limit = current_limit
338
340
 
@@ -348,8 +350,8 @@ module Process
348
350
  handle = OpenJobObjectA(JOB_OBJECT_SET_ATTRIBUTES, true, @win32_process_job_name)
349
351
  raise SystemCallError, FFI.errno, "OpenJobObject" if handle == 0
350
352
  else
351
- @job_name = 'ruby_' + Process.pid.to_s
352
- handle = CreateJobObjectA(nil, job_name)
353
+ @win32_process_job_name = 'ruby_' + Process.pid.to_s
354
+ handle = CreateJobObjectA(nil, @win32_process_job_name)
353
355
  raise SystemCallError, FFI.errno, "CreateJobObject" if handle == 0
354
356
  end
355
357
 
@@ -756,10 +758,12 @@ module Process
756
758
  raise ArgumentError, "bad signal type #{signal.class}"
757
759
  end
758
760
 
759
- # Match the spec, making an exception for BRK/SIGBRK, if the signal name is invalid
761
+ # Match the spec, making an exception for BRK/SIGBRK, if the signal name is invalid.
762
+ # Older versions of JRuby did not include KILL, so we've made an explicit exception
763
+ # for that here, too.
760
764
  if signal.is_a?(String) || signal.is_a?(Symbol)
761
765
  signal = signal.to_s.sub('SIG', '')
762
- unless Signal.list.keys.include?(signal) || ['BRK', 'BRK'].include?(signal)
766
+ unless Signal.list.keys.include?(signal) || ['KILL', 'BRK'].include?(signal)
763
767
  raise ArgumentError, "unsupported name '#{signal}'"
764
768
  end
765
769
  end
@@ -25,7 +25,7 @@ class TC_Win32Process < Test::Unit::TestCase
25
25
  end
26
26
 
27
27
  test "win32-process version is set to the correct value" do
28
- assert_equal('0.7.4', Process::WIN32_PROCESS_VERSION)
28
+ assert_equal('0.7.5', Process::WIN32_PROCESS_VERSION)
29
29
  end
30
30
 
31
31
  test "create basic functionality" do
@@ -74,6 +74,12 @@ class TC_Win32_Process_Kill < Test::Unit::TestCase
74
74
  assert_raise(Errno::EINVAL){ Process.kill(9, 0) }
75
75
  end
76
76
 
77
+ test "kill accepts BRK or SIGBRK as a signal name" do
78
+ pid = Process.spawn(@cmd)
79
+ assert_nothing_raised{ Process.kill(:BRK, pid) }
80
+ assert_nothing_raised{ Process.kill(:SIGBRK, pid) }
81
+ end
82
+
77
83
  # We break from the spec here.
78
84
  #test "an EINVAL error is raised if the pid is the current process and it's not a 0 or SIGKILL" do
79
85
  # assert_raise(Errno::EINVAL){ Process.kill(1, Process.pid) }
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'win32-process'
5
- spec.version = '0.7.4'
5
+ spec.version = '0.7.5'
6
6
  spec.license = 'Artistic 2.0'
7
7
  spec.authors = ['Daniel Berger', 'Park Heesob']
8
8
  spec.email = 'djberg96@gmail.com'
@@ -11,7 +11,6 @@ Gem::Specification.new do |spec|
11
11
  spec.test_files = Dir['test/*.rb']
12
12
  spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
13
13
 
14
- spec.rubyforge_project = 'win32utils'
15
14
  spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
16
15
 
17
16
  spec.required_ruby_version = '> 1.9.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-process
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Berger
@@ -9,48 +9,48 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-21 00:00:00.000000000 Z
12
+ date: 2015-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: 1.0.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: 1.0.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: test-unit
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: 2.4.0
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: 2.4.0
56
56
  description: |2
@@ -67,16 +67,16 @@ extra_rdoc_files:
67
67
  - MANIFEST
68
68
  files:
69
69
  - CHANGES
70
+ - MANIFEST
71
+ - README
72
+ - Rakefile
70
73
  - examples/example_create.rb
71
74
  - examples/example_kill.rb
75
+ - lib/win32/process.rb
72
76
  - lib/win32/process/constants.rb
73
77
  - lib/win32/process/functions.rb
74
78
  - lib/win32/process/helper.rb
75
79
  - lib/win32/process/structs.rb
76
- - lib/win32/process.rb
77
- - MANIFEST
78
- - Rakefile
79
- - README
80
80
  - test/test_win32_process.rb
81
81
  - test/test_win32_process_kill.rb
82
82
  - win32-process.gemspec
@@ -90,17 +90,17 @@ require_paths:
90
90
  - lib
91
91
  required_ruby_version: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - '>'
93
+ - - ">"
94
94
  - !ruby/object:Gem::Version
95
95
  version: 1.9.0
96
96
  required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  requirements:
98
- - - '>='
98
+ - - ">="
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  requirements: []
102
- rubyforge_project: win32utils
103
- rubygems_version: 2.1.9
102
+ rubyforge_project:
103
+ rubygems_version: 2.4.5
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Adds and redefines several Process methods for MS Windows