Sha256: 250a7a5cf6bd49449d2886238086a14e0054f4ee9b5cecc735e39ff723be7251

Contents?: true

Size: 393 Bytes

Versions: 11

Compression:

Stored size: 393 Bytes

Contents

# encoding: utf-8

module Nanoc3::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

11 entries across 11 versions & 1 rubygems

Version Path
nanoc3-3.2.4 lib/nanoc3/tasks/clean.rb
nanoc3-3.2.3 lib/nanoc3/tasks/clean.rb
nanoc3-3.2.2 lib/nanoc3/tasks/clean.rb
nanoc3-3.2.1 lib/nanoc3/tasks/clean.rb
nanoc3-3.2.0 lib/nanoc3/tasks/clean.rb
nanoc3-3.2.0b3 lib/nanoc3/tasks/clean.rb
nanoc3-3.2.0b2 lib/nanoc3/tasks/clean.rb
nanoc3-3.2.0b1 lib/nanoc3/tasks/clean.rb
nanoc3-3.2.0a4 lib/nanoc3/tasks/clean.rb
nanoc3-3.2.0a3 lib/nanoc3/tasks/clean.rb
nanoc3-3.2.0a2 lib/nanoc3/tasks/clean.rb