mirror of
https://github.com/rails/execjs
synced 2023-03-27 23:21:20 -04:00
Merge pull request #95 from ahorek/fix_deprecation_warning
fix deprecation warning ruby 2.7+
This commit is contained in:
commit
ba0300d52a
1 changed files with 3 additions and 3 deletions
|
@ -173,7 +173,7 @@ module ExecJS
|
||||||
begin
|
begin
|
||||||
command = binary.split(" ") << filename
|
command = binary.split(" ") << filename
|
||||||
`#{shell_escape(*command)} 2>&1 > #{path}`
|
`#{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
|
ensure
|
||||||
File.unlink(path) if path
|
File.unlink(path) if path
|
||||||
end
|
end
|
||||||
|
@ -197,7 +197,7 @@ module ExecJS
|
||||||
|
|
||||||
def exec_runtime(filename)
|
def exec_runtime(filename)
|
||||||
command = "#{Shellwords.join(binary.split(' ') << filename)} 2>&1"
|
command = "#{Shellwords.join(binary.split(' ') << filename)} 2>&1"
|
||||||
io = IO.popen(command, @popen_options)
|
io = IO.popen(command, **@popen_options)
|
||||||
output = io.read
|
output = io.read
|
||||||
io.close
|
io.close
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ module ExecJS
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
def exec_runtime(filename)
|
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
|
output = io.read
|
||||||
io.close
|
io.close
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue