Sha256: 9f0ce24858913d648bcf2b0696d9108fc54775ab4427e7f441a88068ff2830e7

Contents?: true

Size: 581 Bytes

Versions: 2

Compression:

Stored size: 581 Bytes

Contents

module Ffprober
  module Ffmpeg
    class VersionValidator
      MIN_VERSION = Gem::Version.new("0.9.0")
      MAX_VERSION = Gem::Version.new("2.6.3")

      def initialize(ffmpeg_version)
        @ffmpeg_version = ffmpeg_version
      end

      def valid?
        ffmpeg_version.nightly? || version_requirement_statisfied?
      end

      private

      def version_requirement_statisfied?
        version = ffmpeg_version.version
        (MIN_VERSION <= version && version <= MAX_VERSION)
      end

      def ffmpeg_version
        @ffmpeg_version
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ffprober-0.4.4 lib/ffprober/ffmpeg/version_validator.rb
ffprober-0.4.3 lib/ffprober/ffmpeg/version_validator.rb