Sha256: 7066bfd4c395a186f8bd10e035d77e4b91e326ffa264d959024e8b9d491d4b33

Contents?: true

Size: 477 Bytes

Versions: 27

Compression:

Stored size: 477 Bytes

Contents

# encoding: utf-8

module Nanoc3::Tasks

  class Clean

    def initialize(site)
      @site = site
    end

    def run
      # Load site data
      @site.load_data

      # Delete all compiled item reps
      filenames.each do |filename|
        FileUtils.rm_f filename unless filename.nil?
      end
    end

  private

    def filenames
      @site.items.map do |item|
        item.reps.map do |rep|
          rep.raw_path
        end
      end.flatten
    end

  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
nanoc3-3.0.6 lib/nanoc3/tasks/clean.rb
nanoc3-3.0.5 lib/nanoc3/tasks/clean.rb
nanoc3-3.0.4 lib/nanoc3/tasks/clean.rb
nanoc3-3.0.3 lib/nanoc3/tasks/clean.rb
nanoc3-3.0.2 lib/nanoc3/tasks/clean.rb
nanoc3-3.0.1 lib/nanoc3/tasks/clean.rb
nanoc3-3.0.0 lib/nanoc3/tasks/clean.rb