File: clean.rb

package info (click to toggle)
ruby-hoe 3.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 440 kB
  • sloc: ruby: 1,886; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 730 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
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
##
# Clean plugin for hoe.
#
# === Tasks Provided:
#
# clean::              Clean up all the extras.

module Hoe::Clean
  ##
  # Optional: An array of file patterns to delete on clean.

  attr_accessor :clean_globs

  ##
  # Initialize variables for plugin.

  def initialize_clean
    self.clean_globs ||= %w(diff diff.txt TAGS ri deps .source_index
                            *.gem **/*~ **/.*~ **/*.rbc coverage*)
  end

  ##
  # Define tasks for plugin.

  def define_clean_tasks
    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
end