Class: IronHammer::Package
- Inherits:
-
Object
- Object
- IronHammer::Package
- Defined in:
- lib/iron_hammer/package.rb
Instance Attribute Summary collapse
-
#deliverables ⇒ Object
Returns the value of attribute deliverables.
-
#root ⇒ Object
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Package
constructor
A new instance of Package.
- #pack! ⇒ Object
- #zip!(file = 'package.zip') ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Package
Returns a new instance of Package.
9 10 11 12 13 14 |
# File 'lib/iron_hammer/package.rb', line 9 def initialize params={} @root = params[:root] || IronHammer::Defaults::DELIVERY_DIRECTORY @deliverables = params[:deliverables] raise(ArgumentError.new "must provide a list of deliverables") unless @deliverables && !@deliverables.empty? end |
Instance Attribute Details
#deliverables ⇒ Object
Returns the value of attribute deliverables.
7 8 9 |
# File 'lib/iron_hammer/package.rb', line 7 def deliverables @deliverables end |
#root ⇒ Object
Returns the value of attribute root.
6 7 8 |
# File 'lib/iron_hammer/package.rb', line 6 def root @root end |
Instance Method Details
#pack! ⇒ Object
16 17 18 19 |
# File 'lib/iron_hammer/package.rb', line 16 def pack! organize_deliverables_for_packaging self end |
#zip!(file = 'package.zip') ⇒ Object
21 22 23 |
# File 'lib/iron_hammer/package.rb', line 21 def zip! file='package.zip' Dir.chdir(@root) { IronHammer::Utils::Zipper::zip_current_working_folder_into_this file } end |