rspec-bash-x 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/rspec/bash/open3.rb +4 -4
- data/lib/rspec/bash/script_evaluator.rb +4 -3
- data/lib/rspec/bash/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: 3143908ceef94f9985ca5a4234aa841fb2eb5ea1
|
4
|
+
data.tar.gz: 2af3b25aad667a9405d148e6b119ed85296a73e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e448146c650e50bd0a29deb61b4a1b0a3d549fbc9cbc6ab0d466f65ca89051a401fd09571222814dc3f923188171d2fabe5748617b0221bfc12f0231cc1fb8b3
|
7
|
+
data.tar.gz: 341db330bcd0436793bc122af9eff45c6d87b0e6c32750fa29e988635ab9611c5721c23a8e8b706d914ab600d5e934ee60b9fc7f2640adc38ae4d541cce95fea
|
data/CHANGELOG.md
CHANGED
data/lib/rspec/bash/open3.rb
CHANGED
@@ -9,7 +9,7 @@ module RSpec
|
|
9
9
|
# the descriptors are available as 62 (child read) and 63 (child write)
|
10
10
|
#
|
11
11
|
# @param [Array<String>] cmd
|
12
|
-
def self.popen3X(cmd, read_fd: 62, write_fd: 63, &block)
|
12
|
+
def self.popen3X(cmd, read_fd: 62, write_fd: 63, env: {}, &block)
|
13
13
|
in_r, in_w = IO.pipe
|
14
14
|
out_r, out_w = IO.pipe
|
15
15
|
err_r, err_w = IO.pipe
|
@@ -23,13 +23,13 @@ module RSpec
|
|
23
23
|
opts[read_fd] = r2b_r
|
24
24
|
opts[write_fd] = b2r_w
|
25
25
|
|
26
|
-
|
26
|
+
combined_env = env.merge({
|
27
27
|
"BASHIT_R_FD" => "#{read_fd}",
|
28
28
|
"BASHIT_W_FD" => "#{write_fd}"
|
29
|
-
}
|
29
|
+
})
|
30
30
|
|
31
31
|
::Open3.send(:popen_run,
|
32
|
-
[
|
32
|
+
[combined_env] + cmd,
|
33
33
|
opts,
|
34
34
|
[in_r, out_w, err_w, r2b_r, b2r_w], # child_io
|
35
35
|
[in_w, out_r, err_r, r2b_w, b2r_r], # parent_io
|
@@ -25,7 +25,7 @@ module RSpec
|
|
25
25
|
# @param [Number?] options.write_fd
|
26
26
|
# @param [Number?] options.throttle
|
27
27
|
def eval(script, args = [], **opts)
|
28
|
-
file = Tempfile.new('rspec_bash')
|
28
|
+
file = opts.fetch(:file, Tempfile.new('rspec_bash'))
|
29
29
|
file.write(script.to_s)
|
30
30
|
file.close
|
31
31
|
verbose = opts.fetch(:verbose, Bash.configuration.verbose)
|
@@ -35,7 +35,8 @@ module RSpec
|
|
35
35
|
|
36
36
|
Bash::Open3.popen3X([ '/usr/bin/env', 'bash', file.path ].concat(args), {
|
37
37
|
read_fd: opts.fetch(:read_fd, Bash.configuration.read_fd),
|
38
|
-
write_fd: opts.fetch(:write_fd, Bash.configuration.write_fd)
|
38
|
+
write_fd: opts.fetch(:write_fd, Bash.configuration.write_fd),
|
39
|
+
env: opts.fetch(:env, {})
|
39
40
|
}) do |input, stdout, stderr, r2b, b2r, wait_thr|
|
40
41
|
workers = []
|
41
42
|
|
@@ -83,7 +84,7 @@ module RSpec
|
|
83
84
|
try_hard "shut off workers" do workers.map(&:join) end
|
84
85
|
try_hard "kill them all" do workers.map(&:kill) end
|
85
86
|
try_hard "clean up temp bus file" do bus_file.unlink end
|
86
|
-
try_hard "clean up source file" do file.unlink end
|
87
|
+
try_hard "clean up source file" do file.unlink unless opts.key?(:file) end
|
87
88
|
|
88
89
|
script.track_exit_code wait_thr.value.exitstatus
|
89
90
|
|
data/lib/rspec/bash/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-bash-x
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ahmad Amireh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-support
|