lib/async/container/thread.rb in async-container-0.18.2 vs lib/async/container/thread.rb in async-container-0.18.3
- old
+ new
@@ -1,9 +1,9 @@
# frozen_string_literal: true
# Released under the MIT License.
-# Copyright, 2020-2022, by Samuel Williams.
+# Copyright, 2020-2024, by Samuel Williams.
# Copyright, 2020, by Olle Jonsson.
require_relative 'channel'
require_relative 'error'
require_relative 'notify/pipe'
@@ -64,17 +64,16 @@
# Execute a child process using {::Process.spawn}. In order to simulate {::Process.exec}, an {Exit} instance is raised to propagage exit status.
# This creates the illusion that this method does not return (normally).
def exec(*arguments, ready: true, **options)
if ready
- self.ready!(status: "(spawn)") if ready
+ self.ready!(status: "(spawn)")
else
self.before_spawn(arguments, options)
end
begin
- # TODO prefer **options... but it doesn't support redirections on < 2.7
- pid = ::Process.spawn(*arguments, options)
+ pid = ::Process.spawn(*arguments, **options)
ensure
_, status = ::Process.wait2(pid)
raise Exit, status
end