Class: IronHammer::Package

Inherits:
Object
  • Object
show all
Defined in:
lib/iron_hammer/package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#deliverablesObject

Returns the value of attribute deliverables.



7
8
9
# File 'lib/iron_hammer/package.rb', line 7

def deliverables
  @deliverables
end

#rootObject

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