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.1.9 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.8 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.7 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.6 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.5 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.4 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.3 lib/nanoc3/tasks/clean.rb
nanoc3-3.2.0a1 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.2 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.1 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.0 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.0rc1 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.0b2 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.0b1 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.0a3 lib/nanoc3/tasks/clean.rb
nanoc3-3.0.9 lib/nanoc3/tasks/clean.rb
nanoc3-3.0.8 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.0a2 lib/nanoc3/tasks/clean.rb
nanoc3-3.1.0a1 lib/nanoc3/tasks/clean.rb
nanoc3-3.0.7 lib/nanoc3/tasks/clean.rb