Sha256: f2937b4ce4b23249b61c6e54ed507c16c0bf746219b689f182281e08425e7ba9

Contents?: true

Size: 792 Bytes

Versions: 6

Compression:

Stored size: 792 Bytes

Contents

require 'backup/connection/dropbox'

module Backup
  module Record
    class Dropbox < Backup::Record::Base
      def load_specific_settings(adapter)
      end

      private

      def self.destroy_backups(procedure, backups)
        dropbox = Backup::Connection::Dropbox.new
        dropbox.static_initialize(procedure)
        session = dropbox.session
        backups.each do |backup|
          puts "\nDestroying backup \"#{backup.filename}\"."
          path_to_file = File.join(dropbox.path, backup.filename)
          begin
            session.delete(path_to_file, :mode => :dropbox)
          rescue ::Dropbox::FileNotFoundError => e
            puts "\n Backup with name '#{backup.filename}' was not found in '#{dropbox.path}'"
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
backup-2.4.5.1 lib/backup/record/dropbox.rb
backup-2.4.5 lib/backup/record/dropbox.rb
namxam-backup-2.4.5 lib/backup/record/dropbox.rb
backup-2.4.4 lib/backup/record/dropbox.rb
backup-2.4.3 lib/backup/record/dropbox.rb
backup-2.4.1 lib/backup/record/dropbox.rb