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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37ab5e0e01c82e59761cee6a57d99453236b354f
4
- data.tar.gz: a0672dcd843064cd0d8b73e13bd0634b6291754c
3
+ metadata.gz: f0a0561f6759a1882a53a023411f8b4c3e1694e6
4
+ data.tar.gz: 2609ee2f323b7d70da60dcc26d746f73b6fac0d8
5
5
  SHA512:
6
- metadata.gz: b65c101d35198019e88302828258d5093d5a43865aa56e59de9631e927637c189346438ad956b0075dc9ac65827b38b67f51d11602689708f570127ea9f93f58
7
- data.tar.gz: 2c2549d8e6e312daa2c89afa37fdd469d7e8b4e4c999dd10c25d21d0cf222d2299b6e03cdc059cb2202ed86d37bb5460b544646bcc330ac891c29a8c55fb8986
6
+ metadata.gz: c108b4b7c2b473162f96aed3d3cc1755c7ae9731b9d03d9c1f068bc2634efdb704f109d015545ebcd6db38364da579431372f3d0aff7e5c5100dae02e8616279
7
+ data.tar.gz: c722ab3ff4543cac6ef865a15c783242634cd006788a914377987dcdd36dbe4cdecee19fbb034fba08e6fb1fb652b32d1f12cf1b92711fd446600deeefb1deae
@@ -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.merge(config).merge(
32
- name: name,
33
- group: @group[:name] )
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)
@@ -1,5 +1,5 @@
1
1
  module Eye
2
2
  module Patch
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
@@ -33,6 +33,7 @@ processes:
33
33
  start_timeout: 25 seconds
34
34
  start_command: bundle exec my-process
35
35
  pid_file: tmp/pids/my-process.pid
36
+ stdall: log/my-process.log
36
37
  - name: first-grouped-process
37
38
  group: my-group
38
39
  config:
@@ -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.7
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-06 00:00:00.000000000 Z
11
+ date: 2014-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eye