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, #tmp_base_path=, #type

Constructor Details

#initializeDir



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

def initialize
  @strategy = :bare
end

Instance Method Details

#configure(options = {}) ⇒ Object



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

def configure(options = {})
  raise "Must provide :path parameter" unless options[:path]
  @path = options[: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