Sha256: 1b12db753a48b56fdbea3fbdf2ba19ed6c2a661767af57d9fdfaaf6b756dd8a2

Contents?: true

Size: 922 Bytes

Versions: 41

Compression:

Stored size: 922 Bytes

Contents

module Bosh::Stemcell
  class ArchiveFilename
    # rubocop:disable ParameterLists
    def initialize(version, infrastructure, operating_system, base_name, light, agent_name = 'ruby')
      @version = version
      @infrastructure = infrastructure
      @operating_system = operating_system
      @base_name = base_name
      @light = light
      @agent_name = agent_name
    end
    # rubocop:enable ParameterLists

    def to_s
      stemcell_filename_parts = [name, version, infrastructure.name, infrastructure.hypervisor, operating_system.name]

      stemcell_filename_parts << "#{agent_name}_agent" unless agent_name == 'ruby'

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

    private

    def name
      light ? "light-#{base_name}" : base_name
    end

    attr_reader(
      :base_name,
      :version,
      :infrastructure,
      :operating_system,
      :light,
      :agent_name,
    )
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
bosh-stemcell-1.5.0.pre.1374 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1365 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1364 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1345 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1341 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1340 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1339 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1337 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1336 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1335 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1333 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1332 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1330 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1328 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1327 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1326 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1324 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1323 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1320 lib/bosh/stemcell/archive_filename.rb
bosh-stemcell-1.5.0.pre.1319 lib/bosh/stemcell/archive_filename.rb