Class: Pageflow::PaperclipProcessors::Vtt

Inherits:
Paperclip::Processor
  • Object
show all
Defined in:
lib/pageflow/paperclip_processors/vtt.rb

Instance Method Summary collapse

Instance Method Details

#makeObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/pageflow/paperclip_processors/vtt.rb', line 7

def make
  destination = make_tempfile_for(file.path)

  if File.extname(file.path) =~ /\.srt$/
    srt_to_vtt(file.path, destination.path)
  else
    FileUtils.cp(file.path, destination.path)
  end

  destination
end