Class: SimpleBackup::Source::Dir

Inherits:
Abstract
  • Object
show all
Defined in:
lib/simple_backup/source/dir.rb

Instance Method Summary collapse

Methods inherited from Abstract

#backends=, #backup_file, #cleanup, #desc, #get, #keep_last, #keep_last=, #name, #name=, #supports, #type

Constructor Details

#initializeDir

Returns a new instance of Dir.



4
5
6
# File 'lib/simple_backup/source/dir.rb', line 4

def initialize
  @strategy = :bare
end

Instance Method Details

#configure(path, options = {}) ⇒ Object



8
9
10
11
12
13
# File 'lib/simple_backup/source/dir.rb', line 8

def configure(path, options = {})
  @path = path

  raise "#{path} is a file - use File source instead of Dir" unless !::File.exist?(path) or ::File.directory?(path)
  @strategy = options[:strategy] if options[:strategy]
end