Sha256: 44b0febded14270f8c9f31256a40a35a2758adb7385d9c1e7446c43a3706d7b4

Contents?: true

Size: 824 Bytes

Versions: 21

Compression:

Stored size: 824 Bytes

Contents

##
# 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
    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
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
hoe-3.25.0 lib/hoe/clean.rb
hoe-3.24.0 lib/hoe/clean.rb
hoe-3.23.1 lib/hoe/clean.rb
hoe-3.23.0 lib/hoe/clean.rb
hoe-3.22.3 lib/hoe/clean.rb
hoe-3.22.2 lib/hoe/clean.rb
hoe-3.22.1 lib/hoe/clean.rb
hoe-3.22.0 lib/hoe/clean.rb
hoe-3.21.0 lib/hoe/clean.rb
hoe-3.20.0 lib/hoe/clean.rb
hoe-3.19.0 lib/hoe/clean.rb
hoe-3.18.1 lib/hoe/clean.rb
hoe-3.18.0 lib/hoe/clean.rb
hoe-3.17.2 lib/hoe/clean.rb
hoe-3.17.1 lib/hoe/clean.rb
hoe-3.17.0 lib/hoe/clean.rb
hoe-3.16.2 lib/hoe/clean.rb
hoe-3.16.1 lib/hoe/clean.rb
hoe-3.16.0 lib/hoe/clean.rb
hoe-3.15.3 lib/hoe/clean.rb