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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a32f17eb6555f7acdbec873cbbec5ebf46395597a197dd64514feb576e4e312e
4
- data.tar.gz: 942bcd53b77aca681b6eea80f945ee8ebba53503aea5a0cf76aaada530467b6d
3
+ metadata.gz: 62a7ca3228b0897aeb31e59b4f27b2f90c3b4b1b179c07e0d4ed84d28d09e709
4
+ data.tar.gz: ee249239d5a1eb40475c7cbdd84bfcdf920e42f01f501cb6247ec760dc4803e2
5
5
  SHA512:
6
- metadata.gz: 5c4db36cc8965ea13bacbc3c597d6c052d87d8bd7cf9965965231f75fac33ca197d8c224f9d3e7110ea4cebbe491f25edbe75093472008e1d6ab779b507dd9a2
7
- data.tar.gz: 9a1f0d9cb12e84e8ba0fb6f7c5615cdca8d14b94f4b30b14fb7e32a94182aa1d658655d068073efcbe3dae5d4c837bfcb919f5b9267f9a38843a4d4747de91ce
6
+ metadata.gz: 4e188eae871a34059daa6dc72938766e21ad9d015456c3479c0d1e62d59b316146d3e8d4d16ece2e11082ae0da536e57f8be76160ca258f0b0b685b5ff6313f4
7
+ data.tar.gz: 53ae67f38a17c607795c53206559df7411633075bbfbb2b468fda0b08acf9cd02ed7a0f45b1b336f5e01a7068075a7529c98a4c3c39cf881290cec99cd401fcf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocov_plugin_kit (0.1.5)
4
+ cocov_plugin_kit (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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 :env, which when provided
29
- # must be a Hash representing environment keys and values.
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: true,
51
+ unsetenv_others: isolate,
48
52
  out: out_writer.fileno,
49
53
  err: err_writer.fileno
50
54
  }.merge options
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocov
4
4
  module PluginKit
5
- VERSION = "0.1.5"
5
+ VERSION = "0.1.6"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocov_plugin_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Gama