Sha256: 0167b0eb9e9adc741dbaa9ef52876134800df92fb0071a3f47e14036b16760cd

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

module AwsCftTools
  module Runbooks
    class Retract
      ##
      # module with methods to manage ordering of templates
      #
      module Templates
        require_relative '../common/templates'

        include Common::Templates

        ##
        # list the templates in-scope for this retraction
        #
        # @return [AwsCftTools::TemplateSet]
        #
        def templates
          @templates ||= filtered_templates(client.templates)
        end

        ##
        # List the templates that are available for deletion.
        #
        # Templates with known dependents that are not in the set will be removed. Note that this does
        # not capture dependencies between environments.
        #
        # @return [AwsCftTools::TemplateSet]
        def free_templates
          set = AwsCftTools::TemplateSet.new(templates.in_folder_order(template_folder_order))
          client.templates.closed_subset(set).reverse
        end

        ##
        # @return [Array<String>]
        #
        def template_folder_order
          options[:template_folder_priorities] || []
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aws-cft-tools-0.1.1 lib/aws_cft_tools/runbooks/retract/templates.rb
aws-cft-tools-0.1.0 lib/aws_cft_tools/runbooks/retract/templates.rb