lib/childprocess/jruby/process.rb in childprocess-0.5.3 vs lib/childprocess/jruby/process.rb in childprocess-0.5.4

- old
+ new

@@ -19,11 +19,12 @@ assert_started @exit_code = @process.exitValue stop_pumps true - rescue java.lang.IllegalThreadStateException + rescue java.lang.IllegalThreadStateException => ex + log(ex.class => ex.message) false ensure log(:exit_code => @exit_code) end @@ -111,10 +112,14 @@ @pumps.each { |pump| pump.stop } end def set_env(env) ENV.to_hash.merge(@environment).each do |k,v| - env.put(k.to_s, v.to_s) if v + if v + env.put(k.to_s, v.to_s) + else + env.remove(k.to_s) if env.key?(k.to_s) + end end end def create_stdin output_stream = @process.getOutputStream