Class: ASRake::Package
- Inherits:
-
BaseExecutable
- Object
- BaseExecutable
- ASRake::Package
- Includes:
- Rake::DSL
- Defined in:
- lib/asrake/package.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
Attributes inherited from BaseExecutable
#output, #output_dir, #output_file
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(file = nil) ⇒ Package
constructor
A new instance of Package.
- #to_s ⇒ Object
Methods inherited from BaseExecutable
#merge_in, #output_is_dir?, #pathmap, #to_str
Constructor Details
#initialize(file = nil) ⇒ Package
Returns a new instance of Package.
12 13 14 |
# File 'lib/asrake/package.rb', line 12 def initialize(file=nil) super(file) end |
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files.
10 11 12 |
# File 'lib/asrake/package.rb', line 10 def files @files end |
Instance Method Details
#execute ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/asrake/package.rb', line 30 def execute rm_r output rescue nil Zip::ZipFile.open(output, Zip::ZipFile::CREATE) do |zipfile| files.each do |to, from| zipfile.add(Path::forward(to), Path::forward(from)) end end end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/asrake/package.rb', line 26 def to_s @output end |