childprocess 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/childprocess/jruby/process.rb +11 -4
- data/lib/childprocess/version.rb +1 -1
- data/spec/childprocess_spec.rb +13 -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: 5ff6c21571973bc86342b2e8f604487ead0ac6d5
|
4
|
+
data.tar.gz: f6603ff7e7c6244d3f740a045b505e5b2b7f4d9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e275ff71f12bef3f8fc39657bfa4bd1ac350bcd98fadd1dc12794da8abf62d83acda8b21e244acfefa5f11c42937792e1d7b3b23cbcd97d5ecaf4aa77e7d13e0
|
7
|
+
data.tar.gz: c3ed5e6312b4457066585d02487b7bbf7a887702a89ea66bfc99f9bc3710e37d4c25a92af6496cf4ddbc1311035102bf975b2627e0d3417fd9e2fc774a4e2f7e
|
@@ -113,13 +113,20 @@ module ChildProcess
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def set_env(env)
|
116
|
-
ENV.to_hash
|
116
|
+
merged = ENV.to_hash
|
117
|
+
|
118
|
+
@environment.each { |k, v| merged[k.to_s] = v }
|
119
|
+
|
120
|
+
merged.each do |k, v|
|
117
121
|
if v
|
118
|
-
env.put(k
|
119
|
-
|
120
|
-
env.remove(k
|
122
|
+
env.put(k, v.to_s)
|
123
|
+
elsif env.has_key? k
|
124
|
+
env.remove(k)
|
121
125
|
end
|
122
126
|
end
|
127
|
+
|
128
|
+
removed_keys = env.key_set.to_a - merged.keys
|
129
|
+
removed_keys.each { |k| env.remove(k) }
|
123
130
|
end
|
124
131
|
|
125
132
|
def create_stdin
|
data/lib/childprocess/version.rb
CHANGED
data/spec/childprocess_spec.rb
CHANGED
@@ -124,6 +124,19 @@ describe ChildProcess do
|
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
127
|
+
it 'does not see env vars unset in parent' do
|
128
|
+
Tempfile.open('env-spec') do |file|
|
129
|
+
ENV['CHILDPROCESS_UNSET'] = nil
|
130
|
+
process = write_env(file.path)
|
131
|
+
process.start
|
132
|
+
|
133
|
+
process.wait
|
134
|
+
|
135
|
+
child_env = eval rewind_and_read(file)
|
136
|
+
expect(child_env).to_not have_key('CHILDPROCESS_UNSET')
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
127
140
|
|
128
141
|
it "passes arguments to the child" do
|
129
142
|
args = ["foo", "bar"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: childprocess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Bakken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|