sensu-spawn 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4e9592d734d945fcf26e348005e0f2df803c8aa
4
- data.tar.gz: 7e71bfdb98d5ab897588d9b6d6e5347e8202b7ad
3
+ metadata.gz: 4ea4fcadcb1f44d2d8689949572a6686b331a36b
4
+ data.tar.gz: 236cba9c84b45157dcf00b9570a22ec29d5b2f01
5
5
  SHA512:
6
- metadata.gz: a8a7896d3bb3bf2177d31fbb97115e130cebb1db4a285d517ce8607498cbad191e2048347e144c7e2f40a9a599f20e86d7775e8c58e15320583150a6285dff1c
7
- data.tar.gz: ecc2e3714598a4665630f506e6f4213af33c7253d56b48a787978c726f9b2f85883e136cedfd049fbe6756f1a16c87c6c0e92770bc37ff00d9760b6846ab6a1f
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 = true
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-spawn"
5
- spec.version = "1.6.0"
5
+ spec.version = "1.7.0"
6
6
  spec.authors = ["Sean Porter"]
7
7
  spec.email = ["portertech@gmail.com"]
8
8
  spec.summary = "The Sensu spawn process library"
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.6.0
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: 2015-11-13 00:00:00.000000000 Z
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.2.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: