lib/bosh/stemcell/archive_filename.rb in bosh-stemcell-1.5.0.pre.1210 vs lib/bosh/stemcell/archive_filename.rb in bosh-stemcell-1.5.0.pre.1211
- old
+ new
@@ -1,29 +1,37 @@
module Bosh::Stemcell
class ArchiveFilename
- def initialize(version, infrastructure, operating_system, base_name, light)
+ # 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
+ attr_reader(
+ :base_name,
+ :version,
+ :infrastructure,
+ :operating_system,
+ :light,
+ :agent_name,
+ )
end
end