cocov_plugin_kit 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cocov/plugin_kit/exec.rb +8 -4
- data/lib/cocov/plugin_kit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62a7ca3228b0897aeb31e59b4f27b2f90c3b4b1b179c07e0d4ed84d28d09e709
|
4
|
+
data.tar.gz: ee249239d5a1eb40475c7cbdd84bfcdf920e42f01f501cb6247ec760dc4803e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e188eae871a34059daa6dc72938766e21ad9d015456c3479c0d1e62d59b316146d3e8d4d16ece2e11082ae0da536e57f8be76160ca258f0b0b685b5ff6313f4
|
7
|
+
data.tar.gz: 53ae67f38a17c607795c53206559df7411633075bbfbb2b468fda0b08acf9cd02ed7a0f45b1b336f5e01a7068075a7529c98a4c3c39cf881290cec99cd401fcf
|
data/Gemfile.lock
CHANGED
@@ -12,7 +12,7 @@ module Cocov
|
|
12
12
|
|
13
13
|
# Internal: Initializes a new ExecutionError instance
|
14
14
|
def initialize(status, stdout, stderr, cmd, env)
|
15
|
-
super("Process #{cmd.split.first} exited with status #{status}")
|
15
|
+
super("Process #{cmd.split.first} exited with status #{status}: #{stdout}\n#{stderr}")
|
16
16
|
@status = status
|
17
17
|
@stdout = stdout
|
18
18
|
@stderr = stderr
|
@@ -25,8 +25,11 @@ module Cocov
|
|
25
25
|
|
26
26
|
# Public: Executes a given command (represented as an array of strings),
|
27
27
|
# returning both its stdout and stderr streams as Strings. Extra options
|
28
|
-
# are passed directly to Process.spawn, except
|
29
|
-
# must be a Hash representing environment
|
28
|
+
# are passed directly to Process.spawn, except:
|
29
|
+
# - env: when provided must be a Hash representing environment
|
30
|
+
# keys and values.
|
31
|
+
# - isolate_env: Prevents the current ENV from being copied into the new
|
32
|
+
# process. Just a fancier name to :unsetenv_others
|
30
33
|
# This function will block until the process finishes, either returning
|
31
34
|
# both streams (stdout, stderr) as an Array, or raising an ExecutionError.
|
32
35
|
#
|
@@ -40,11 +43,12 @@ module Cocov
|
|
40
43
|
out_reader, out_writer = IO.pipe
|
41
44
|
err_reader, err_writer = IO.pipe
|
42
45
|
|
46
|
+
isolate = options.delete(:isolate_env) == true
|
43
47
|
env = (options.delete(:env) || {}).to_h { |*a| a.map(&:to_s) }
|
44
48
|
options.delete(:chdir) if options.fetch(:chdir, nil).nil?
|
45
49
|
|
46
50
|
opts = {
|
47
|
-
unsetenv_others:
|
51
|
+
unsetenv_others: isolate,
|
48
52
|
out: out_writer.fileno,
|
49
53
|
err: err_writer.fileno
|
50
54
|
}.merge options
|