lib/ffprober/ffmpeg/version_validator.rb in ffprober-0.5.5 vs lib/ffprober/ffmpeg/version_validator.rb in ffprober-1.0
- old
+ new
@@ -1,25 +1,32 @@
+# typed: strict
# frozen_string_literal: true
module Ffprober
module Ffmpeg
class VersionValidator
- MIN_VERSION = Gem::Version.new('0.9.0')
+ 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