process_starter 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,8 @@ module ProcessStarter
17
17
  attr_accessor :allowed_methods
18
18
  end
19
19
 
20
- self.allowed_methods = [:psexec,:start,:posix_spawn,:spawn,:fork]
20
+ #self.allowed_methods = [:psexec,:start,:posix_spawn,:spawn,:fork]
21
+ self.allowed_methods = [:psexec,:start,:spawn,:fork]
21
22
 
22
23
  def self.log(m)
23
24
  defined?(RAILS_DEFAULT_LOGGER) ? RAILS_DEFAULT_LOGGER.info(m) : puts(m)
@@ -34,7 +35,9 @@ module ProcessStarter
34
35
  @@have_psexec ||= allowed_methods.include?(:psexec) ? ((`psexec /?` rescue "") =~ /computer/ ? 2 : 1) : -1
35
36
  if @@have_psexec == 2 and allowed_methods.include?(:psexec)
36
37
  log "starting using psexec"
37
- r = system("psexec -d #{s}")
38
+ # -d = detach (nowait)
39
+ # -w = current working directory
40
+ r = system("psexec -d -w #{Dir.pwd} #{s}")
38
41
  else
39
42
  log "starting using START cmd /c (inherits descriptors (?) - bad)"
40
43
  system("start cmd /c #{s}")
@@ -31,7 +31,7 @@ class ProcessStarterTest < Test::Unit::TestCase
31
31
 
32
32
  # r = ProcessStarter.start("ruby test/test2child.arb 120 >test/chout 2>&1")
33
33
 
34
- ProcessStarter.start("ruby test/test2child.arb 120", [:start,:fork] )
34
+ ProcessStarter.start("ruby test/test2child.arb 120", [:psexec, :start,:fork] )
35
35
  #stat = Process::waitpid(r)
36
36
 
37
37
  #puts "i started child, r=#{r}, status = #{stat.inspect}"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: process_starter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 7
10
- version: 1.0.7
9
+ - 8
10
+ version: 1.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pavel Vasev
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-10-07 00:00:00 +06:00
18
+ date: 2012-10-18 00:00:00 +06:00
19
19
  default_executable:
20
20
  dependencies: []
21
21