process_starter 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/process_starter.rb +4 -3
  2. metadata +3 -3
@@ -21,10 +21,11 @@ module ProcessStarter
21
21
  # not waiting for it's finish, so child process run in parralel
22
22
  # not inheritting file descriptors, so it finds and closes all opened handels
23
23
  # works in windows and linux
24
- def self.start(s, allowed_methods=[:psexec,:start,:posix_spawn,:spawn,:fork])
25
- log "********* ProcessStarter.start INVOKING EXTERNAL COMMAND #{s}, WINRUN IS #{WINRUN}, HAVE_POSIX_SPAWN IS #{HAVE_POSIX_SPAWN}, HAVE_SPAWN is #{HAVE_SPAWN}"
24
+ def self.start(s, allowed_methods = nil )
25
+ allowed_methods ||= [:psexec,:start,:posix_spawn,:spawn,:fork]
26
+ log "********* ProcessStarter.start INVOKING EXTERNAL COMMAND #{s}, WINRUN IS #{WINRUN}, HAVE_POSIX_SPAWN IS #{HAVE_POSIX_SPAWN}, HAVE_SPAWN is #{HAVE_SPAWN}, allowed_methods are #{allowed_methods.inspect}"
26
27
  if WINRUN
27
- @@have_psexec ||= ((`psexec /?` rescue "") =~ /computer/ ? 2 : 1)
28
+ @@have_psexec ||= allowed_methods.include?(:psexec) ? ((`psexec /?` rescue "") =~ /computer/ ? 2 : 1) : -1
28
29
  if @@have_psexec == 2 and allowed_methods.include?(:psexec)
29
30
  log "starting using psexec"
30
31
  r = system("psexec -d #{s}")
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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 4
10
- version: 1.0.4
9
+ - 5
10
+ version: 1.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pavel Vasev