sensu-spawn 1.6.0 → 1.7.0
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.
- checksums.yaml +4 -4
- data/lib/sensu/spawn.rb +11 -1
- data/sensu-spawn.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ea4fcadcb1f44d2d8689949572a6686b331a36b
|
4
|
+
data.tar.gz: 236cba9c84b45157dcf00b9570a22ec29d5b2f01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93e35357ae4384270a83c193558d1018e136271a7b06e501456e026d90fdf10053570d9e753a0471a1fa068e7845a03b9c2d5dc0320bd91a3c68a0beb49203a0
|
7
|
+
data.tar.gz: 3dbc3c822168f0d1cb1f1e1e870e3d8c88103cd4469ee327118ddda459d215277c8c53e35bf22613935f81999a97c12b854b7af00fc55790e67b3dd414673531
|
data/lib/sensu/spawn.rb
CHANGED
@@ -15,6 +15,8 @@ rescue LoadError; end
|
|
15
15
|
|
16
16
|
module Sensu
|
17
17
|
module Spawn
|
18
|
+
POSIX_SPAWN_PLATFORMS = [:linux, :macosx].freeze
|
19
|
+
|
18
20
|
@@mutex = Mutex.new
|
19
21
|
|
20
22
|
class << self
|
@@ -36,6 +38,14 @@ module Sensu
|
|
36
38
|
@process_worker.enqueue(create, callback)
|
37
39
|
end
|
38
40
|
|
41
|
+
# Determine if POSIX Spawn is used to create child processes on
|
42
|
+
# the current platform. ChildProcess supports POSIX Spawn for
|
43
|
+
# several platforms (OSs & architectures), however, Sensu only
|
44
|
+
# enables the use of POSIX Spawn on a select few.
|
45
|
+
def posix_spawn?
|
46
|
+
@posix_spawn ||= POSIX_SPAWN_PLATFORMS.include?(ChildProcess.os)
|
47
|
+
end
|
48
|
+
|
39
49
|
# Build a child process attached to a pipe, in order to capture
|
40
50
|
# its output (STDERR, STDOUT). The child process will be a
|
41
51
|
# platform dependent shell, that is responsible for executing
|
@@ -51,7 +61,7 @@ module Sensu
|
|
51
61
|
else
|
52
62
|
["sh", "-c"]
|
53
63
|
end
|
54
|
-
ChildProcess.posix_spawn =
|
64
|
+
ChildProcess.posix_spawn = posix_spawn?
|
55
65
|
shell_command = shell + [command]
|
56
66
|
child = ChildProcess.build(*shell_command)
|
57
67
|
child.io.stdout = child.io.stderr = writer
|
data/sensu-spawn.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-spawn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Porter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
149
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.
|
150
|
+
rubygems_version: 2.4.5.1
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: The Sensu spawn process library
|
@@ -155,3 +155,4 @@ test_files:
|
|
155
155
|
- spec/assets/output_1MB
|
156
156
|
- spec/helpers.rb
|
157
157
|
- spec/spawn_spec.rb
|
158
|
+
has_rdoc:
|