Sha256: 32888f124020691f0509e8c61500b8c945e0d7b16d42fd3dc28f61b5f29bdeab
Contents?: true
Size: 906 Bytes
Versions: 1
Compression:
Stored size: 906 Bytes
Contents
module Ffprober class FfprobeVersion @@version_regex = /^(ffprobe|avprobe|ffmpeg) version (\d+)\.?(\d+)\.?(\d+)*/ @@nightly_regex = /^(ffprobe|avprobe|ffmpeg) version (N|git)-/ MIN_VERSION = Gem::Version.new("0.9.0") MAX_VERSION = Gem::Version.new("1.2.1") def self.valid? self.new.valid? end def valid? nightly? || (MIN_VERSION <= version && version <= MAX_VERSION) end def parse_version @parse_version ||= begin _p = version_output.match(@@version_regex) if _p.nil? [0, 0, 0] else [_p[2].to_i, _p[3].to_i, _p[4].to_i] end end end def version @version ||= Gem::Version.new(parse_version.join(".")) end def nightly? !!(version_output =~ @@nightly_regex) end def version_output @version_output ||= `#{Ffprober.path} -version` end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ffprober-0.3.2 | lib/ffprober/ffprobe_version.rb |