Class: Captain::Release
- Inherits:
-
Object
- Object
- Captain::Release
- Defined in:
- lib/captain/release.rb
Defined Under Namespace
Classes: Component
Instance Attribute Summary collapse
-
#architecture ⇒ Object
readonly
Returns the value of attribute architecture.
-
#codename ⇒ Object
readonly
Returns the value of attribute codename.
-
#components ⇒ Object
readonly
Returns the value of attribute components.
Instance Method Summary collapse
- #copy_to(directory, config) ⇒ Object
-
#initialize(codename, architecture, packages) ⇒ Release
constructor
A new instance of Release.
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
#architecture ⇒ Object (readonly)
Returns the value of attribute architecture.
7 8 9 |
# File 'lib/captain/release.rb', line 7 def architecture @architecture end |
#codename ⇒ Object (readonly)
Returns the value of attribute codename.
8 9 10 |
# File 'lib/captain/release.rb', line 8 def codename @codename end |
#components ⇒ Object (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 |