Class: ThumbUploader

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
Includes:
Sinatra::Videoman
Defined in:
lib/sinatra/videoman/thumb_uploader.rb

Constant Summary

Constants included from Sinatra::Videoman

Sinatra::Videoman::VERSION

Instance Method Summary collapse

Instance Method Details

#extension_white_listObject



13
14
15
# File 'lib/sinatra/videoman/thumb_uploader.rb', line 13

def extension_white_list
  Manager.config[:thumb_file_extensions]
end

#filenameObject



17
18
19
20
21
22
# File 'lib/sinatra/videoman/thumb_uploader.rb', line 17

def filename
  if original_filename
    @name ||= Digest::MD5.hexdigest(File.dirname(current_path))
    "#{@name}.#{file.extension}"
  end
end

#store_dirObject



9
10
11
# File 'lib/sinatra/videoman/thumb_uploader.rb', line 9

def store_dir
  Manager.config[:thumb_upload_dir]
end