tests: skip ugoira tests if ffmpeg/mkvmerge not installed.

This commit is contained in:
evazion
2019-09-01 13:10:37 -05:00
parent 3216f83ad8
commit 6e7b882dda
5 changed files with 22 additions and 30 deletions

View File

@@ -1,5 +1,11 @@
class PixivUgoiraConverter
def self.enabled?
system("type -p ffmpeg > /dev/null") && system("type -p mkvmerge > /dev/null")
end
def self.generate_webm(ugoira_file, frame_data)
raise NotImplementedError, "can't convert ugoira to webm: ffmpeg or mkvmerge not installed" unless enabled?
folder = Zip::File.new(ugoira_file.path)
output_file = Tempfile.new(binmode: true)
write_path = output_file.path