Class: Ffprober::Ffmpeg::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/ffprober/ffmpeg/finder.rb

Class Method Summary collapse

Class Method Details

.executable_nameObject



14
15
16
# File 'lib/ffprober/ffmpeg/finder.rb', line 14

def self.executable_name
  @executable_name ||= self.windows? ? "ffprobe.exe" : "ffprobe"
end

.pathObject



4
5
6
7
8
9
10
11
12
# File 'lib/ffprober/ffmpeg/finder.rb', line 4

def self.path
  @path ||= begin
    path = ENV["PATH"].split(File::PATH_SEPARATOR).detect do |path_to_check|
      File.executable?(File.join(path_to_check, executable_name))
    end

    path && File.expand_path(executable_name, path)
  end
end

.windows?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/ffprober/ffmpeg/finder.rb', line 18

def self.windows?
  !!(RUBY_PLATFORM =~ /(mingw|mswin)/)
end