process_starter 1.0.5 → 1.0.7
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.
- data/lib/process_starter.rb +7 -1
- metadata +4 -4
data/lib/process_starter.rb
CHANGED
@@ -13,6 +13,12 @@ module ProcessStarter
|
|
13
13
|
HAVE_SPAWN = defined?(spawn) ? true : false # have Ruby 1.9 spawn method
|
14
14
|
HAVE_POSIX_SPAWN = defined?(POSIX::Spawn::spawn) ? true : false # loaded posix/spawn lib
|
15
15
|
|
16
|
+
class << self
|
17
|
+
attr_accessor :allowed_methods
|
18
|
+
end
|
19
|
+
|
20
|
+
self.allowed_methods = [:psexec,:start,:posix_spawn,:spawn,:fork]
|
21
|
+
|
16
22
|
def self.log(m)
|
17
23
|
defined?(RAILS_DEFAULT_LOGGER) ? RAILS_DEFAULT_LOGGER.info(m) : puts(m)
|
18
24
|
end
|
@@ -22,7 +28,7 @@ module ProcessStarter
|
|
22
28
|
# not inheritting file descriptors, so it finds and closes all opened handels
|
23
29
|
# works in windows and linux
|
24
30
|
def self.start(s, allowed_methods = nil )
|
25
|
-
allowed_methods ||=
|
31
|
+
allowed_methods ||= self.allowed_methods
|
26
32
|
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}"
|
27
33
|
if WINRUN
|
28
34
|
@@have_psexec ||= allowed_methods.include?(:psexec) ? ((`psexec /?` rescue "") =~ /computer/ ? 2 : 1) : -1
|
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:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 7
|
10
|
+
version: 1.0.7
|
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-
|
18
|
+
date: 2012-10-07 00:00:00 +06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|