Sha256: bff0d625312cbdfaa6b6bd9ca4be233f3ebcdd1ff4c48349614e4b63032bbb58

Contents?: true

Size: 822 Bytes

Versions: 23

Compression:

Stored size: 822 Bytes

Contents

require 'bosh/stemcell/arch'
require 'forwardable'

module Bosh::Stemcell
  class ArchiveFilename
    extend Forwardable

    def initialize(version, definition, base_name, disk_format)
      @version = version
      @definition = definition
      @base_name = base_name
      @disk_format = disk_format
    end

    def to_s
      stemcell_filename_parts = [
        name,
        version,
        definition.stemcell_name(disk_format)
      ]

      "#{stemcell_filename_parts.join('-')}.tgz"
    end

    private

    def name
      mod_name = definition.light? ? "light-#{base_name}" : base_name
      if Bosh::Stemcell::Arch.ppc64le?
        "#{mod_name}-ppc64le"
      else
        mod_name
      end
    end

    attr_reader(
      :base_name,
      :version,
      :definition,
      :disk_format,
    )
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
bosh-stemcell-1.3262.24.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3232.24.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3232.14.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3262.4.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3262.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3232.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3215.4.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3215.3.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3215.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3213.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3202.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3200.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3197.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3196.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3192.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3191.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3189.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3184.1.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3184.0 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.3181.0 lib/bosh/stemcell/archive_filename.rb