Class: Capistrano::Deploy::Strategy::CopyPackage

Inherits:
Copy
  • Object
show all
Defined in:
lib/capistrano/recipes/deploy/strategy/copy_package.rb

Overview

Specialized copy strategy that expects the compressed package to exist after the source is built.

Instance Method Summary collapse

Instance Method Details

#package_fileObject

Returns the location of the local package file. Returns nil unless :package_file has been set. If :package_file is true, a default file location will be returned.



13
14
15
16
17
18
19
# File 'lib/capistrano/recipes/deploy/strategy/copy_package.rb', line 13

def package_file
  @package_file ||= begin
    file = configuration[:package_file]
    file = "#{package_name}.#{compression.extension}" if TrueClass === file
    File.expand_path(configuration[:package_file], copy_dir) rescue nil
  end
end

#package_nameObject

Returns the package name. Used as a default basename for :package_file



22
23
24
# File 'lib/capistrano/recipes/deploy/strategy/copy_package.rb', line 22

def package_name
  @package_name ||= configuration[:package_name] || "#{configuration[:application]}-#{File.basename(destination)}"
end