gilmour 0.3.1 → 0.3.2
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/gilmour/backends/redis.rb +8 -0
- data/lib/gilmour/responder.rb +3 -3
- data/lib/gilmour/stdhijack.rb +2 -2
- data/test/spec/test_subscriber_redis_forked.rb +1 -0
- data/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b164c237e9423f1bbcc3e91cf3dc94c376c7163e
|
4
|
+
data.tar.gz: 87aec87330f766c0e5428fa301637e077dc61a41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9227f1a16c983556caaa99b9a712e3641d0f208f517eab8eba0fb3001f543146c57284ea8b1cda44982099ad69a40b54ddaa31069384b5c165a5ec5292c778ff
|
7
|
+
data.tar.gz: ec09fe7036f7829e1d5478b6f8ffcdd97216a09b94822b5c29bb5803af4f5f23b477f8bfea1d19da9f9ac5ee4b83dbe1478ea0373df2041a94c5c406e368029f
|
@@ -41,6 +41,10 @@ module Gilmour
|
|
41
41
|
|
42
42
|
@report_errors = opts["broadcast_errors"] || opts[:broadcast_errors]
|
43
43
|
@report_errors = true if @report_errors != false
|
44
|
+
|
45
|
+
@capture_stdout = opts["capture_stdout"] || opts[:capture_stdout]
|
46
|
+
@capture_stdout = false if @capture_stdout != true
|
47
|
+
|
44
48
|
@ident = generate_ident
|
45
49
|
end
|
46
50
|
|
@@ -52,6 +56,10 @@ module Gilmour
|
|
52
56
|
"#{Socket.gethostname}-pid-#{Process.pid}-uuid-#{SecureRandom.uuid}"
|
53
57
|
end
|
54
58
|
|
59
|
+
def capture_stdout?
|
60
|
+
@capture_stdout
|
61
|
+
end
|
62
|
+
|
55
63
|
def report_health?
|
56
64
|
@report_health
|
57
65
|
end
|
data/lib/gilmour/responder.rb
CHANGED
@@ -22,7 +22,6 @@ module Gilmour
|
|
22
22
|
end
|
23
23
|
|
24
24
|
class Responder
|
25
|
-
CAPTURE_STDOUT = false
|
26
25
|
LOG_SEPERATOR = '%%'
|
27
26
|
LOG_PREFIX = "#{LOG_SEPERATOR}gilmour#{LOG_SEPERATOR}"
|
28
27
|
|
@@ -60,6 +59,7 @@ module Gilmour
|
|
60
59
|
@pipe = IO.pipe
|
61
60
|
@publish_pipe = IO.pipe
|
62
61
|
@logger = make_logger()
|
62
|
+
@capture_stdout = @backend.capture_stdout? || false
|
63
63
|
end
|
64
64
|
|
65
65
|
def receive_data(data)
|
@@ -184,7 +184,7 @@ module Gilmour
|
|
184
184
|
parent_io = [out_r]
|
185
185
|
child_io = [out_w]
|
186
186
|
|
187
|
-
if
|
187
|
+
if @capture_stdout == true
|
188
188
|
err_r, err_w = IO.pipe
|
189
189
|
child_io << err_w
|
190
190
|
parent_io << err_r
|
@@ -202,7 +202,7 @@ module Gilmour
|
|
202
202
|
@response_sent = false
|
203
203
|
@logger = fork_logger
|
204
204
|
|
205
|
-
capture_output(child_io,
|
205
|
+
capture_output(child_io, @capture_stdout) {
|
206
206
|
_execute(handler)
|
207
207
|
}
|
208
208
|
end
|
data/lib/gilmour/stdhijack.rb
CHANGED
@@ -18,10 +18,10 @@ def capture_output(pipes, capture_stdout=false)
|
|
18
18
|
streams = []
|
19
19
|
|
20
20
|
if capture_stdout == true
|
21
|
-
streams <<
|
21
|
+
streams << STDOUT
|
22
22
|
end
|
23
23
|
|
24
|
-
streams <<
|
24
|
+
streams << STDERR
|
25
25
|
|
26
26
|
# Save the streams to be reassigned later.
|
27
27
|
# Actually it doesn't matter because the child process would be killed
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gilmour
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aditya Godbole
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-07-
|
12
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|