Sha256: 27ee2d501b2341b53f40a88c7ba8db64163b4464c436f83a223d3a52603b4f0f

Contents?: true

Size: 625 Bytes

Versions: 11

Compression:

Stored size: 625 Bytes

Contents

module OpenStax::Aws
  class PackerFactory

    # There are differences between Packer 1.2 and 1.4.  This factory attempts to
    # provide the right version of packer class.

    def self.new_packer(absolute_file_path:, dry_run: true)
      packer_version = `packer --version`

      raise "packer is not installed" if packer_version.nil?

      packer_class =
        case packer_version
        when /^1.2/
          Packer_1_2_5
        else
          Packer_1_4_1
        end

      @packer = packer_class.new(absolute_file_path: absolute_file_path,
                                 dry_run: dry_run)
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
openstax_aws-2.1.0 lib/openstax/aws/packer_factory.rb
openstax_aws-2.0.1 lib/openstax/aws/packer_factory.rb
openstax_aws-2.0.0 lib/openstax/aws/packer_factory.rb
openstax_aws-1.6.1 lib/openstax/aws/packer_factory.rb
openstax_aws-1.6.0 lib/openstax/aws/packer_factory.rb
openstax_aws-1.5.0 lib/openstax/aws/packer_factory.rb
openstax_aws-1.4.0 lib/openstax/aws/packer_factory.rb
openstax_aws-1.3.0 lib/openstax/aws/packer_factory.rb
openstax_aws-1.2.0 lib/openstax/aws/packer_factory.rb
openstax_aws-1.1.0 lib/openstax/aws/packer_factory.rb
openstax_aws-1.0.0 lib/openstax/aws/packer_factory.rb