Class: Ffprober::Ffmpeg::Version
- Inherits:
-
Object
- Object
- Ffprober::Ffmpeg::Version
- Extended by:
- T::Sig
- Defined in:
- lib/ffprober/ffmpeg/version.rb
Constant Summary collapse
- VERSION_REGEX =
T.let(/^(ffprobe|avprobe|ffmpeg) version (\d+)\.?(\d+)\.?(\d+)*/.freeze, Regexp)
- NIGHTLY_REGEX =
T.let(/^(ffprobe|avprobe|ffmpeg) version (N|git)-/.freeze, Regexp)
- VERSION_FALLBACK =
T.let([0, 0, 0].freeze, T::Array[Integer])
Instance Method Summary collapse
-
#initialize(ffprobe_exec = Ffprober::Ffmpeg::Exec.new) ⇒ Version
constructor
A new instance of Version.
- #nightly? ⇒ Boolean
- #version ⇒ Object
Constructor Details
#initialize(ffprobe_exec = Ffprober::Ffmpeg::Exec.new) ⇒ Version
Returns a new instance of Version.
10 11 12 13 14 |
# File 'lib/ffprober/ffmpeg/version.rb', line 10 def initialize(ffprobe_exec = Ffprober::Ffmpeg::Exec.new) @ffprobe_exec = ffprobe_exec @version = T.let(nil, T.nilable(Gem::Version)) @parse_version = T.let(nil, T.nilable(T::Array[Integer])) end |
Instance Method Details
#nightly? ⇒ Boolean
26 27 28 |
# File 'lib/ffprober/ffmpeg/version.rb', line 26 def nightly? !(ffprobe_version_output =~ NIGHTLY_REGEX).nil? end |
#version ⇒ Object
21 22 23 |
# File 'lib/ffprober/ffmpeg/version.rb', line 21 def version @version ||= Gem::Version.new(parse_version.join('.')) end |