Module: MPV::Utils

Defined in:
lib/mpv/utils.rb

Overview

Various utility methods for ruby-mpv.

Class Method Summary collapse

Class Method Details

.which?(util) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Tests whether the given utility is available in the system path.

Parameters:

  • util (String)

    the utility to test

Returns:

  • (Boolean)

    whether or not the utility is available



8
9
10
11
12
# File 'lib/mpv/utils.rb', line 8

def self.which?(util)
  ENV["PATH"].split(File::PATH_SEPARATOR).any? do |path|
    File.executable?(File.join(path, util))
  end
end