Skip to content

Commit ba0300d

Browse files
authoredMay 7, 2021
Merge pull request #95 from ahorek/fix_deprecation_warning
fix deprecation warning ruby 2.7+
2 parents f6dc08c + c9d2fc6 commit ba0300d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎lib/execjs/external_runtime.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def exec_runtime(filename)
173173
begin
174174
command = binary.split(" ") << filename
175175
`#{shell_escape(*command)} 2>&1 > #{path}`
176-
output = File.open(path, 'rb', @popen_options) { |f| f.read }
176+
output = File.open(path, 'rb', **@popen_options) { |f| f.read }
177177
ensure
178178
File.unlink(path) if path
179179
end
@@ -197,7 +197,7 @@ def shell_escape(*args)
197197

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.