Class: Insup::Uploader::DummyUploader

Inherits:
Insup::Uploader show all
Defined in:
lib/insup/uploader/dummy_uploader.rb

Instance Method Summary collapse

Methods inherited from Insup::Uploader

#delete_file, find_uploader, #initialize, uploader

Constructor Details

This class inherits a constructor from Insup::Uploader

Instance Method Details

#batch_upload(files) ⇒ Object



20
21
22
# File 'lib/insup/uploader/dummy_uploader.rb', line 20

def batch_upload(files)
  puts "Batch uploading #{files.count} files"
end

#remove_file(file) ⇒ Object



16
17
18
# File 'lib/insup/uploader/dummy_uploader.rb', line 16

def remove_file file
  puts "Deleting file #{file.path}".red
end

#upload_file(file) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/insup/uploader/dummy_uploader.rb', line 7

def upload_file(file)
  case file.state
  when Insup::TrackedFile::NEW
    puts "Creating file #{file.path}".green
  when Insup::TrackedFile::MODIFIED, Insup::TrackedFile::UNSURE
    puts "Uploading file #{file.path}".yellow
  end
end