Sha256: eace11de0a62ef334ac12201443be4d5e2de74fef24fb584d848e1d2325e80a1

Contents?: true

Size: 852 Bytes

Versions: 16

Compression:

Stored size: 852 Bytes

Contents

require 'r10k/git/cache'
require 'r10k/deployment/environment'
require 'r10k/util/purgeable'

module R10K
class Deployment
class Basedir
  # Represents a directory containing environments

  def initialize(path,deployment)
    @path       = path
    @deployment = deployment
  end

  include R10K::Util::Purgeable

  # Return the path of the basedir
  # @note This implements a required method for the Purgeable mixin
  # @return [String]
  def managed_directory
    @path
  end

  # List all environments that should exist in this basedir
  # @note This implements a required method for the Purgeable mixin
  # @return [Array<String>]
  def desired_contents
    @keepers = []
    @deployment.sources.each do |source|
      next unless source.managed_directory == @path
      @keepers += source.desired_contents
    end
    @keepers
  end

end
end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
r10k-1.2.4 lib/r10k/deployment/basedir.rb
r10k-1.3.2 lib/r10k/deployment/basedir.rb
r10k-1.2.3 lib/r10k/deployment/basedir.rb
r10k-1.3.1 lib/r10k/deployment/basedir.rb
r10k-1.2.2 lib/r10k/deployment/basedir.rb
r10k-1.3.0 lib/r10k/deployment/basedir.rb
r10k-1.3.0rc1 lib/r10k/deployment/basedir.rb
r10k-1.2.1 lib/r10k/deployment/basedir.rb
r10k-1.2.0 lib/r10k/deployment/basedir.rb
r10k-1.2.0rc2 lib/r10k/deployment/basedir.rb
r10k-1.1.4 lib/r10k/deployment/basedir.rb
r10k-1.2.0rc1 lib/r10k/deployment/basedir.rb
r10k-1.1.3 lib/r10k/deployment/basedir.rb
r10k-1.1.2 lib/r10k/deployment/basedir.rb
r10k-1.1.1 lib/r10k/deployment/basedir.rb
r10k-1.1.1rc1 lib/r10k/deployment/basedir.rb