summaryrefslogtreecommitdiff
path: root/test/lib/find_executable.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2019-06-29 19:43:47 +0900
committerHiroshi SHIBATA <[email protected]>2019-07-02 07:59:54 +0900
commitc3c0e3f5c9444c197779cb242de46dfffda79dec (patch)
tree03866471345f8c9baa68d548340199408aa51405 /test/lib/find_executable.rb
parent142617c8e1cad65fa483c5beb78ab40a99626a87 (diff)
Move to tool/lib from test/lib.
Diffstat (limited to 'test/lib/find_executable.rb')
-rw-r--r--test/lib/find_executable.rb22
1 files changed, 0 insertions, 22 deletions
diff --git a/test/lib/find_executable.rb b/test/lib/find_executable.rb
deleted file mode 100644
index 89c6fb8f3b..0000000000
--- a/test/lib/find_executable.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-require "rbconfig"
-
-module EnvUtil
- def find_executable(cmd, *args)
- exts = RbConfig::CONFIG["EXECUTABLE_EXTS"].split | [RbConfig::CONFIG["EXEEXT"]]
- ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
- next if path.empty?
- path = File.join(path, cmd)
- exts.each do |ext|
- cmdline = [path + ext, *args]
- begin
- return cmdline if yield(IO.popen(cmdline, "r", err: [:child, :out], &:read))
- rescue
- next
- end
- end
- end
- nil
- end
- module_function :find_executable
-end