Sha256: fb588abee457445c1105f0d2ee00d6fd08cb371f283a6fd339451781bd069f30

Contents?: true

Size: 1.02 KB

Versions: 4

Compression:

Stored size: 1.02 KB

Contents

require 'fileutils'

module Zen
  module Task
    ##
    # The Clean task can be used to remove various files from the repository.
    #
    # @author Yorick Peterse
    # @since  0.2
    #
    class Clean < Thor
      include Thor::Actions

      namespace :clean

      ##
      # Removes all log files from the spec directory.
      #
      # @author Yorick Peterse
      # @since  0.2
      #
      desc 'log', 'Removes all log files from the spec directory'
      def log
        zen_path = File.expand_path('../../../../', __FILE__)

        log_files = Dir.glob("#{zen_path}/spec/log/**/*.log")
        log_files.each { |file| File.unlink(file) }
      end

      ##
      # Removes all files generated by YARD.
      #
      # @author Yorick Peterse
      # @since  0.2
      #
      desc 'yard', 'Removes all files generated by YARD'
      def yard
        zen_path = File.expand_path('../../../../', __FILE__)

        FileUtils.rm_rf("#{zen_path}/doc")
        FileUtils.rm_rf("#{zen_path}/.yardoc")
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
zen-0.2.4.1 lib/zen/task/clean.rb
zen-0.2.4 lib/zen/task/clean.rb
zen-0.2.3 lib/zen/task/clean.rb
zen-0.2 lib/zen/task/clean.rb