class Resizing::CarrierWave::Storage::Remote
ref. github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/storage/abstract.rb
Public Instance Methods
cache!(new_file)
click to toggle source
# File lib/resizing/carrier_wave/storage/remote.rb, line 27 def cache!(new_file) f = Resizing::CarrierWave::Storage::File.new(uploader) f.store(new_file) f end
clean_cache!(seconds)
click to toggle source
# File lib/resizing/carrier_wave/storage/remote.rb, line 42 def clean_cache!(seconds) # do nothing # # connection.directories.new( # :key => uploader.fog_directory, # :public => uploader.fog_public # ).files.all(:prefix => uploader.cache_dir).each do |file| # # generate_cache_id returns key formated TIMEINT-PID(-COUNTER)-RND # time = file.key.scan(/(\d+)-\d+-\d+(?:-\d+)?/).first.map { |t| t.to_i } # time = Time.at(*time) # file.destroy if time < (Time.now.utc - seconds) # end end
delete_dir!(path)
click to toggle source
# File lib/resizing/carrier_wave/storage/remote.rb, line 38 def delete_dir!(path) # do nothing, because there's no such things as 'empty directory' end
remove!(file)
click to toggle source
# File lib/resizing/carrier_wave/storage/remote.rb, line 16 def remove!(file) f = Resizing::CarrierWave::Storage::File.new(uploader) f.delete(file) @filename = f.public_id.to_s f end
retrieve!(identifier)
click to toggle source
# File lib/resizing/carrier_wave/storage/remote.rb, line 23 def retrieve!(identifier) Resizing::CarrierWave::Storage::File.new(uploader, identifier) end
retrieve_from_cache!(identifier)
click to toggle source
# File lib/resizing/carrier_wave/storage/remote.rb, line 33 def retrieve_from_cache!(identifier) # NOP # Resizing::CarrierWave::Storage::File..new(uploader, uploader.cache_path(identifier)) end
store!(file)
click to toggle source
# File lib/resizing/carrier_wave/storage/remote.rb, line 9 def store!(file) f = Resizing::CarrierWave::Storage::File.new(uploader) f.store(file) @filename = f.public_id.to_s f end