Class: Sprout::ZipTask

Inherits:
Rake::FileTask
  • Object
show all
Defined in:
lib/sprout/tasks/zip_task.rb

Overview

The ZipTask should accept any directory as input and either an expected zip file name or directory where one will be created for output. The resulting zip file will only be generated if a file in the input directory has a newer timestamp than the existing zip file

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#excludesObject



81
82
83
# File 'lib/sprout/tasks/zip_task.rb', line 81

def excludes
  @excludes ||= ['.', '..', '.svn', '.cvs', '.DS_Store', '.git', 'CVS', 'Thumbs.db']
end

#inputObject



73
74
75
# File 'lib/sprout/tasks/zip_task.rb', line 73

def input
  @input ||= nil
end

#outputObject



69
70
71
# File 'lib/sprout/tasks/zip_task.rb', line 69

def output
  @output ||= nil
end

Class Method Details

.define_task(*args) {|t| ... } ⇒ Object

:nodoc:

Yields:

  • (t)


58
59
60
61
62
# File 'lib/sprout/tasks/zip_task.rb', line 58

def self.define_task(*args, &block) # :nodoc:
  t = super
  yield t if block_given?
  t.define
end

Instance Method Details

#defineObject

:nodoc:



64
65
66
67
# File 'lib/sprout/tasks/zip_task.rb', line 64

def define # :nodoc:
  @input = define_input(input)
  @output = define_output(output || name)
end

#execute(*args) ⇒ Object

:nodoc:



77
78
79
# File 'lib/sprout/tasks/zip_task.rb', line 77

def execute(*args) # :nodoc:
  create_archive
end