def detect_version(executable_path)
      capture = ShellCapture.new(version_command(executable_path))
      unless capture.command_found
        raise Cliver::Dependency::NotFound.new(
            "Could not find an executable at given path '#{executable_path}'." +
            "If this path was not specified explicitly, it is probably a " +
            "bug in [Cliver](https://github.com/yaauie/cliver/issues)."
          )
      end
      capture.stdout[version_pattern] || capture.stderr[version_pattern]
    end
def detect_version(executable_path)
      capture = ShellCapture.new(version_command(executable_path))
      unless capture.command_found
        raise Cliver::Dependency::NotFound.new(
            "Could not find an executable at given path '#{executable_path}'." +
            "If this path was not specified explicitly, it is probably a " +
            "bug in [Cliver](https://github.com/yaauie/cliver/issues)."
          )
      end
      capture.stdout[version_pattern] || capture.stderr[version_pattern]
    end
Forgiving input, allows either argument if only one supplied.

 @overload initialize(*command_args)
   @param command_args [Array<String>]
 @overload initialize(version_pattern)
   @param version_pattern [Regexp]
 @overload initialize(*command_args, version_pattern)
   @param command_args [Array<String>]
   @param version_pattern [Regexp]
 @param executable_path [String] - the path to the executable to test
 @return [String] - should be contain {Gem::Version}-parsable
                    version number.