eye-patch 0.0.7 → 0.0.8
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/eye/patch/overrides.rb +21 -0
- data/lib/eye/patch/process_set.rb +4 -3
- data/lib/eye/patch/version.rb +1 -1
- data/test/fixtures/test.yml +1 -0
- data/test/lib/eye/patch_test.rb +8 -0
- 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: f0a0561f6759a1882a53a023411f8b4c3e1694e6
|
4
|
+
data.tar.gz: 2609ee2f323b7d70da60dcc26d746f73b6fac0d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c108b4b7c2b473162f96aed3d3cc1755c7ae9731b9d03d9c1f068bc2634efdb704f109d015545ebcd6db38364da579431372f3d0aff7e5c5100dae02e8616279
|
7
|
+
data.tar.gz: c722ab3ff4543cac6ef865a15c783242634cd006788a914377987dcdd36dbe4cdecee19fbb034fba08e6fb1fb652b32d1f12cf1b92711fd446600deeefb1deae
|
data/lib/eye/patch/overrides.rb
CHANGED
@@ -7,6 +7,27 @@ Eye::Cli.class_eval do
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
+
Eye::System.class_eval do
|
11
|
+
private
|
12
|
+
|
13
|
+
def spawn_options(config = {})
|
14
|
+
o = {pgroup: true, chdir: config[:working_dir] || '/'}
|
15
|
+
o.update(out: [config[:stdout], 'a']) if config[:stdout]
|
16
|
+
o.update(err: [config[:stderr], 'a']) if config[:stderr]
|
17
|
+
o.update(in: config[:stdin]) if config[:stdin]
|
18
|
+
o.update(close_others: !config[:preserve_fds])
|
19
|
+
|
20
|
+
if Eye::Local.root?
|
21
|
+
o.update(uid: Etc.getpwnam(config[:uid]).uid) if config[:uid]
|
22
|
+
o.update(gid: Etc.getpwnam(config[:gid]).gid) if config[:gid]
|
23
|
+
end
|
24
|
+
|
25
|
+
o.update(umask: config[:umask]) if config[:umask]
|
26
|
+
|
27
|
+
o
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
10
31
|
Eye::Controller.class_eval do
|
11
32
|
private
|
12
33
|
|
@@ -28,9 +28,10 @@ module Eye::Patch
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def parse_single_process(name, config)
|
31
|
-
self[name] = @group
|
32
|
-
|
33
|
-
|
31
|
+
self[name] = @group
|
32
|
+
.merge(stdout: config[:stdall], stderr: config[:stdall])
|
33
|
+
.merge(config)
|
34
|
+
.merge(name: name, group: @group[:name])
|
34
35
|
end
|
35
36
|
|
36
37
|
def indexed_config(config, index)
|
data/lib/eye/patch/version.rb
CHANGED
data/test/fixtures/test.yml
CHANGED
data/test/lib/eye/patch_test.rb
CHANGED
@@ -79,5 +79,13 @@ describe Eye::Patch do
|
|
79
79
|
process = @application[:groups]["__default__"][:processes].values.first
|
80
80
|
assert_equal @application[:triggers], process[:triggers]
|
81
81
|
end
|
82
|
+
|
83
|
+
it "sets :stderr and :stdout options for each process from passed :stdall" do
|
84
|
+
process = @original["processes"].reject { |process| process["group"] }.first
|
85
|
+
parsed_process = @application[:groups]["__default__"][:processes].values.first
|
86
|
+
|
87
|
+
assert_equal process["config"]["stdall"], parsed_process[:stdout]
|
88
|
+
assert_equal process["config"]["stdall"], parsed_process[:stderr]
|
89
|
+
end
|
82
90
|
end
|
83
91
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eye-patch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Horner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eye
|