Class: Captain::Release

Inherits:
Object
  • Object
show all
Defined in:
lib/captain/release.rb

Defined Under Namespace

Classes: Component

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(codename, architecture, packages) ⇒ Release

Returns a new instance of Release.



11
12
13
14
15
16
# File 'lib/captain/release.rb', line 11

def initialize(codename, architecture, packages)
  @codename     = codename
  @architecture = architecture
  @components   = organize_into_components(packages)
  @packages     = packages.sort_by { |p| p.filename }
end

Instance Attribute Details

#architectureObject (readonly)

Returns the value of attribute architecture.



7
8
9
# File 'lib/captain/release.rb', line 7

def architecture
  @architecture
end

#codenameObject (readonly)

Returns the value of attribute codename.



8
9
10
# File 'lib/captain/release.rb', line 8

def codename
  @codename
end

#componentsObject (readonly)

Returns the value of attribute components.



9
10
11
# File 'lib/captain/release.rb', line 9

def components
  @components
end

Instance Method Details

#copy_to(directory, config) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/captain/release.rb', line 18

def copy_to(directory, config)
  directory = Pathname.new(directory)

  @packages.each   { |p| p.copy_to(directory) }
  @components.each { |c| c.copy_to(directory.join('dists', @codename)) }

  Resource.template('release.erb', binding).copy_to(directory.join('dists', @codename, 'Release'))
end