Sha256: e843bde9b275f6b779f88303eb9ba230c742dede0c13e1ddef065429ada94be0

Contents?: true

Size: 554 Bytes

Versions: 4

Compression:

Stored size: 554 Bytes

Contents

module Ffprober
  module Ffmpeg
    class Finder
      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

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ffprober-0.4.6 lib/ffprober/ffmpeg/finder.rb
ffprober-0.4.5 lib/ffprober/ffmpeg/finder.rb
ffprober-0.4.4 lib/ffprober/ffmpeg/finder.rb
ffprober-0.4.3 lib/ffprober/ffmpeg/finder.rb