Skip to content

Commit

Permalink
Merge pull request #95 from ahorek/fix_deprecation_warning
Browse files Browse the repository at this point in the history
fix deprecation warning ruby 2.7+
  • Loading branch information
byroot authored May 7, 2021
2 parents f6dc08c + c9d2fc6 commit ba0300d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/execjs/external_runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def exec_runtime(filename)
begin
command = binary.split(" ") << filename
`#{shell_escape(*command)} 2>&1 > #{path}`
output = File.open(path, 'rb', @popen_options) { |f| f.read }
output = File.open(path, 'rb', **@popen_options) { |f| f.read }
ensure
File.unlink(path) if path
end
Expand All @@ -197,7 +197,7 @@ def shell_escape(*args)

def exec_runtime(filename)
command = "#{Shellwords.join(binary.split(' ') << filename)} 2>&1"
io = IO.popen(command, @popen_options)
io = IO.popen(command, **@popen_options)
output = io.read
io.close

Expand All @@ -209,7 +209,7 @@ def exec_runtime(filename)
end
else
def exec_runtime(filename)
io = IO.popen(binary.split(' ') << filename, @popen_options.merge({err: [:child, :out]}))
io = IO.popen(binary.split(' ') << filename, **(@popen_options.merge({err: [:child, :out]})))
output = io.read
io.close

Expand Down

0 comments on commit ba0300d

Please sign in to comment.