Sha256: 068428cf1789661bde09191a691b0a04b16560b441893898c11967c6a5c53db4

Contents?: true

Size: 731 Bytes

Versions: 1

Compression:

Stored size: 731 Bytes

Contents

# typed: strict
# frozen_string_literal: true

module Ffprober
  module Ffmpeg
    class VersionValidator
      extend T::Sig

      MIN_VERSION = T.let(Gem::Version.new('0.9.0'), Gem::Version)

      sig { params(ffmpeg_version: Ffprober::Ffmpeg::Version).void }
      def initialize(ffmpeg_version)
        @ffmpeg_version = ffmpeg_version
      end

      sig { returns(T::Boolean) }
      def valid?
        ffmpeg_version.nightly? || version_requirement_statisfied?
      end

      private

      sig { returns(T::Boolean) }
      def version_requirement_statisfied?
        MIN_VERSION <= ffmpeg_version.version
      end

      sig { returns(Ffprober::Ffmpeg::Version) }
      attr_reader :ffmpeg_version
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffprober-1.0 lib/ffprober/ffmpeg/version_validator.rb