Class: Shoe::Tasks::Clean
Overview
Defines `rake clean`
to remove .gitignore
d files and directories.
Uses something like `{git clean}[http://www.kernel.org/pub/software/scm/git/docs/git-clean.html] -fdX`
, except preserves .bundle/
.
To enable, version your project with git.
To configure, edit your {.gitignore}[http://www.kernel.org/pub/software/scm/git/docs/gitignore.html]
.
Instance Attribute Summary
Attributes inherited from Task
Instance Method Summary collapse
Methods inherited from Task
Constructor Details
This class inherits a constructor from Shoe::Tasks::Task
Instance Method Details
#active? ⇒ Boolean
16 17 18 |
# File 'lib/shoe/tasks/clean.rb', line 16 def active? File.directory?('.git') end |
#define ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/shoe/tasks/clean.rb', line 20 def define desc " Remove ignored files.\n Configure via your .gitignore file. Uses something like `git clean -fdX`,\n except preserves .bundle/.\n END\n\n task :clean do\n rm_r ignored_files - preserved_files\n end\nend\n".gsub(/^ */, '') |