Sha256: 7ac4fa820eaab57dd73f70e02416b141cbf1b654efce3a68ecd549204b7300fd

Contents?: true

Size: 392 Bytes

Versions: 31

Compression:

Stored size: 392 Bytes

Contents

# encoding: utf-8

module Nanoc::Tasks

  class Clean

    def initialize(site)
      @site = site
    end

    def run
      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

31 entries across 31 versions & 1 rubygems

Version Path
nanoc-3.7.3 lib/nanoc/tasks/clean.rb
nanoc-3.7.2 lib/nanoc/tasks/clean.rb
nanoc-3.7.1 lib/nanoc/tasks/clean.rb
nanoc-3.7.0 lib/nanoc/tasks/clean.rb
nanoc-3.6.11 lib/nanoc/tasks/clean.rb
nanoc-3.6.10 lib/nanoc/tasks/clean.rb
nanoc-3.6.9 lib/nanoc/tasks/clean.rb
nanoc-3.6.8 lib/nanoc/tasks/clean.rb
nanoc-3.6.7 lib/nanoc/tasks/clean.rb
nanoc-3.6.6 lib/nanoc/tasks/clean.rb
nanoc-3.6.5 lib/nanoc/tasks/clean.rb
nanoc-3.6.4 lib/nanoc/tasks/clean.rb
nanoc-3.6.3 lib/nanoc/tasks/clean.rb
nanoc-3.6.2 lib/nanoc/tasks/clean.rb
nanoc-3.6.1 lib/nanoc/tasks/clean.rb
nanoc-3.6.0 lib/nanoc/tasks/clean.rb
nanoc-3.5.0 lib/nanoc/tasks/clean.rb
nanoc-3.5.0b2 lib/nanoc/tasks/clean.rb
nanoc-3.5.0b1 lib/nanoc/tasks/clean.rb
nanoc-3.4.3 lib/nanoc/tasks/clean.rb