1
0
Fork 0
mirror of https://github.com/rails/execjs synced 2023-03-27 23:21:20 -04:00

Remove test arg/match support

Unused as v8 binary runtime was deprecated and removed

Reverts 5d0d51b6ba
This commit is contained in:
Joshua Peek 2014-05-19 16:38:28 -05:00
parent f89845aed6
commit 9cef65185b

View file

@ -82,8 +82,6 @@ module ExecJS
@name = options[:name]
@command = options[:command]
@runner_path = options[:runner_path]
@test_args = options[:test_args]
@test_match = options[:test_match]
@encoding = options[:encoding]
@deprecated = !!options[:deprecated]
@binary = nil
@ -100,7 +98,7 @@ module ExecJS
private
def binary
@binary ||= locate_binary
@binary ||= which(@command)
end
def locate_executable(cmd)
@ -133,17 +131,6 @@ module ExecJS
end
end
def locate_binary
if binary = which(@command)
if @test_args
output = `#{shell_escape(binary, @test_args)} 2>&1`
binary if output.match(@test_match)
else
binary
end
end
end
def which(command)
Array(command).find do |name|
name, args = name.split(/\s+/, 2)