win32-process 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,12 @@
1
+ = 0.5.7 - 27-Mar-2008
2
+ * Fixed issues with thread_inherit and process_inherit in the Process.create
3
+ method. This in turn required an update to windows-pr. Thanks go to Steve
4
+ Shreeve for the spot.
5
+ * Fixed a potential issue with startf_flags and stdin/stdout/stderr handling.
6
+ Thanks again go to Steve Shreeve for the spot and the patch.
7
+ * Fixed the code so that it no longer emits redefinition warnings.
8
+ * Fixed a bug in the Rake install task (for non-gem installations).
9
+
1
10
  == 0.5.6 - 13-Mar-2008
2
11
  * Fixed a bug in the Process.waitpid2 method where it wasn't returning the
3
12
  proper exit code. Thanks go to Jeremy Bopp for the spot and the patch.
data/README CHANGED
@@ -83,9 +83,6 @@
83
83
  == Notes
84
84
  It is unlikely you will be able to kill system processes with this module.
85
85
  It's probably better that you don't.
86
-
87
- You will see some warnings about redefined methods if you run your code
88
- with warnings enabled. Yup, we redefined some methods. :)
89
86
 
90
87
  == Known Bugs
91
88
  None known (though please see the +Details+ section for quirks). Any
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ include Config
6
6
  desc 'Install the win32-process package (non-gem)'
7
7
  task :install do
8
8
  install_dir = File.join(CONFIG["sitelibdir"], 'win32')
9
- Dir.mkdir(installdir) unless File.exists?(install_dir)
9
+ Dir.mkdir(install_dir) unless File.exists?(install_dir)
10
10
  cp 'lib/win32/process.rb', install_dir, :verbose => true
11
11
  end
12
12
 
data/lib/win32/process.rb CHANGED
@@ -10,8 +10,11 @@ require 'windows/unicode'
10
10
 
11
11
  module Process
12
12
  class Error < RuntimeError; end
13
+
14
+ # Eliminates redefinition warnings.
15
+ undef_method :kill, :wait, :wait2, :waitpid, :waitpid2
13
16
 
14
- WIN32_PROCESS_VERSION = '0.5.6'
17
+ WIN32_PROCESS_VERSION = '0.5.7'
15
18
 
16
19
  include Windows::Process
17
20
  include Windows::Thread
@@ -358,18 +361,18 @@ module Process
358
361
 
359
362
  # Process SECURITY_ATTRIBUTE structure
360
363
  process_security = 0
361
- if hash['process_inherit?']
364
+ if hash['process_inherit']
362
365
  process_security = [0,0,0].pack('LLL')
363
366
  process_security[0,4] = [12].pack('L') # sizeof(SECURITY_ATTRIBUTE)
364
- process_security[8,4] = [hash['process_inherit?']].pack('L')
367
+ process_security[8,4] = [1].pack('L') # TRUE
365
368
  end
366
369
 
367
370
  # Thread SECURITY_ATTRIBUTE structure
368
371
  thread_security = 0
369
- if hash['thread_security?']
372
+ if hash['thread_inherit']
370
373
  thread_security = [0,0,0].pack('LLL')
371
374
  thread_security[0,4] = [12].pack('L') # sizeof(SECURITY_ATTRIBUTE)
372
- thread_security[8,4] = [hash['thread_inherit?']].pack('L')
375
+ thread_security[8,4] = [1].pack('L') # TRUE
373
376
  end
374
377
 
375
378
  # Automatically handle stdin, stdout and stderr as either IO objects
@@ -387,6 +390,7 @@ module Process
387
390
  end
388
391
 
389
392
  si_hash[io] = handle
393
+ si_hash['startf_flags'] ||= 0
390
394
  si_hash['startf_flags'] |= STARTF_USESTDHANDLES
391
395
  hash['inherit'] = true
392
396
  end
@@ -643,6 +647,7 @@ ProcessError = Process::Error
643
647
 
644
648
  # Create a global fork method
645
649
  module Kernel
650
+ undef_method :fork # Eliminate redefinition warning
646
651
  def fork(&block)
647
652
  Process.fork(&block)
648
653
  end
data/test/tc_process.rb CHANGED
@@ -43,7 +43,7 @@ class TC_Win32Process < Test::Unit::TestCase
43
43
  end
44
44
 
45
45
  def test_version
46
- assert_equal('0.5.6', Process::WIN32_PROCESS_VERSION)
46
+ assert_equal('0.5.7', Process::WIN32_PROCESS_VERSION)
47
47
  end
48
48
 
49
49
  def test_kill
@@ -3,9 +3,10 @@ require "rubygems"
3
3
  spec = Gem::Specification.new do |gem|
4
4
  desc = "Adds create, fork, wait, wait2, waitpid, and a special kill method"
5
5
  gem.name = "win32-process"
6
- gem.version = "0.5.6"
6
+ gem.version = "0.5.7"
7
7
  gem.authors = ['Daniel Berger', 'Park Heesob']
8
8
  gem.email = "djberg96@gmail.com"
9
+ gem.rubyforge_project = 'win32utils'
9
10
  gem.homepage = "http://www.rubyforge.org/projects/win32utils"
10
11
  gem.platform = Gem::Platform::RUBY
11
12
  gem.summary = desc
@@ -16,7 +17,7 @@ spec = Gem::Specification.new do |gem|
16
17
  gem.files.reject! { |fn| fn.include? "CVS" }
17
18
  gem.require_path = "lib"
18
19
  gem.extra_rdoc_files = ["README", "CHANGES", "MANIFEST"]
19
- gem.add_dependency("windows-pr", ">= 0.7.4")
20
+ gem.add_dependency("windows-pr", ">= 0.8.1")
20
21
  end
21
22
 
22
23
  if $0 == __FILE__
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.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Berger
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2008-03-13 00:00:00 -06:00
13
+ date: 2008-03-27 00:00:00 -06:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.7.4
23
+ version: 0.8.1
24
24
  version:
25
25
  description: Adds create, fork, wait, wait2, waitpid, and a special kill method
26
26
  email: djberg96@gmail.com
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version:
67
67
  requirements: []
68
68
 
69
- rubyforge_project:
69
+ rubyforge_project: win32utils
70
70
  rubygems_version: 1.0.1
71
71
  signing_key:
72
72
  specification_version: 2