Class: Bosh::Cli::BackupDestinationPath

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/backup_destination_path.rb

Instance Method Summary collapse

Constructor Details

#initialize(director) ⇒ BackupDestinationPath

Returns a new instance of BackupDestinationPath.



5
6
7
# File 'lib/cli/backup_destination_path.rb', line 5

def initialize(director)
  @director = director
end

Instance Method Details

#create_from_path(dest_path = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/cli/backup_destination_path.rb', line 9

def create_from_path(dest_path = nil)
  dest_path ||= Dir.pwd

  if File.directory?(dest_path)
    File.join(dest_path, default_backup_name)
  else
    is_tar_path?(dest_path) ? dest_path : "#{dest_path}.tgz"
  end
end