Class: Ffprober::Ffmpeg::Finder
- Inherits:
-
Object
- Object
- Ffprober::Ffmpeg::Finder
- Defined in:
- lib/ffprober/ffmpeg/finder.rb
Constant Summary collapse
- SEARCH_PATHS =
ENV['PATH']
Class Method Summary collapse
Class Method Details
.executable_name ⇒ Object
13 14 15 |
# File 'lib/ffprober/ffmpeg/finder.rb', line 13 def self.executable_name @executable_name ||= windows? ? 'ffprobe.exe' : 'ffprobe' end |
.executable_path ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/ffprober/ffmpeg/finder.rb', line 21 def self.executable_path @executable_path ||= begin SEARCH_PATHS.split(File::PATH_SEPARATOR).detect do |path_to_check| File.executable?(File.join(path_to_check, executable_name)) end end end |
.path ⇒ Object
8 9 10 11 |
# File 'lib/ffprober/ffmpeg/finder.rb', line 8 def self.path raise Ffprober::NoFfprobeFound if executable_path.nil? @path ||= File.(executable_name, executable_path) end |
.windows? ⇒ Boolean
17 18 19 |
# File 'lib/ffprober/ffmpeg/finder.rb', line 17 def self.windows? !(RUBY_PLATFORM =~ /(mingw|mswin)/).nil? end |