Module: Hoe::Clean
- Defined in:
- lib/hoe/clean.rb
Overview
Clean plugin for hoe.
Tasks Provided:
- clean
-
Clean up all the extras.
Instance Attribute Summary collapse
-
#clean_globs ⇒ Object
Optional: An array of file patterns to delete on clean.
Instance Method Summary collapse
-
#define_clean_tasks ⇒ Object
Define tasks for plugin.
-
#initialize_clean ⇒ Object
Initialize variables for plugin.
Instance Attribute Details
#clean_globs ⇒ Object
Optional: An array of file patterns to delete on clean.
12 13 14 |
# File 'lib/hoe/clean.rb', line 12 def clean_globs @clean_globs end |
Instance Method Details
#define_clean_tasks ⇒ Object
Define tasks for plugin.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/hoe/clean.rb', line 25 def define_clean_tasks task :clobber_docs # no-op, just in case task :clobber_package # no-op, just in case desc "Clean up all the extras." task :clean => [ :clobber_docs, :clobber_package ] do clean_globs.each do |pattern| files = Dir[pattern] rm_rf files, :verbose => true unless files.empty? end end end |
#initialize_clean ⇒ Object
Initialize variables for plugin.
17 18 19 20 |
# File 'lib/hoe/clean.rb', line 17 def initialize_clean self.clean_globs ||= %w[diff diff.txt TAGS ri deps .source_index *.gem **/*~ **/.*~ **/*.rbc] end |