Class: Inventory::Rake::Tasks::Clean
- Inherits:
-
Object
- Object
- Inventory::Rake::Tasks::Clean
- Extended by:
- Rake::DSL
- Includes:
- Rake::DSL
- Defined in:
- lib/inventory-rake-1.0/tasks/clean.rb
Overview
Tasks for cleaning up a project directory.
Instance Attribute Summary collapse
-
#files ⇒ Array<String>
The files to delete.
-
#name ⇒ Symbol
The name of the task.
Class Method Summary collapse
Instance Method Summary collapse
Constructor Details
#initialize(name, files = []) {|?| ... } ⇒ Clean
44 45 46 47 48 |
# File 'lib/inventory-rake-1.0/tasks/clean.rb', line 44 def initialize(name, files = []) @name, @files = name, files yield self if block_given? define end |
Instance Attribute Details
#files ⇒ Array<String>
Returns The files to delete.
61 62 63 |
# File 'lib/inventory-rake-1.0/tasks/clean.rb', line 61 def files @files end |
#name ⇒ Symbol
Returns The name of the task.
58 59 60 |
# File 'lib/inventory-rake-1.0/tasks/clean.rb', line 58 def name @name end |
Class Method Details
.define ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/inventory-rake-1.0/tasks/clean.rb', line 10 def define # Defines the following tasks: # # <dl> # <dt>mostlyclean</dt> # <dd>Delete targets built by rake that are ofter rebuilt.</dd> # # <dt>clean</dt> # <dd>Delete targets builty by rake; depends on mostlyclean.</dd> # # <dt>distclean</dt> # <dd>Delete all files not meant for distribution; depends on # clean.</dd> # </dl> desc 'Delete targets built by rake that are often rebuilt' new :mostlyclean, Inventory::Rake::Tasks.mostlycleanfiles desc 'Delete targets built by rake' new :clean, Inventory::Rake::Tasks.cleanfiles task :clean => :mostlyclean desc 'Delete all files not meant for distribution' new :distclean, Inventory::Rake::Tasks.distcleanfiles task :distclean => :clean end |