Class: Ffprober::Ffmpeg::Version
- Inherits:
-
Object
- Object
- Ffprober::Ffmpeg::Version
- Defined in:
- lib/ffprober/ffmpeg/version.rb
Constant Summary collapse
- VERSION_REGEX =
/^(ffprobe|avprobe|ffmpeg) version (\d+)\.?(\d+)\.?(\d+)*/- NIGHTLY_REGEX =
/^(ffprobe|avprobe|ffmpeg) version (N|git)-/- VERSION_FALLBACK =
[0, 0, 0].freeze
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.
7 8 9 10 11 |
# File 'lib/ffprober/ffmpeg/version.rb', line 7 def initialize(ffprobe_exec = Ffprober::Ffmpeg::Exec.new) @ffprobe_exec = ffprobe_exec @version = nil @parse_version = nil end |
Instance Method Details
#nightly? ⇒ Boolean
21 22 23 |
# File 'lib/ffprober/ffmpeg/version.rb', line 21 def nightly? !(ffprobe_version_output =~ NIGHTLY_REGEX).nil? end |
#version ⇒ Object
17 18 19 |
# File 'lib/ffprober/ffmpeg/version.rb', line 17 def version @version ||= Gem::Version.new(parse_version.join('.')) end |