Sha256: b02dede8daa2bd74e2ae818631b587a3947a3e6bc00bfcd55dff32bd38552242

Contents?: true

Size: 530 Bytes

Versions: 5

Compression:

Stored size: 530 Bytes

Contents

# Should be called *after* the revision
module Spontaneous::Publishing::Steps
  class CreateRevisionDirectory < BaseStep

    def call
      @progress.stage("creating revision directory")
      FileUtils.mkdir_p(path / "tmp")
      @progress.step(count, path)
    end

    def count
      1
    end

    # This is the reason for the existance of this step: cleaning up when it's gone wrong
    def rollback
      FileUtils.rm_r(path) if File.exist?(path)
    end

    def path
      @site.revision_dir(revision)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 lib/spontaneous/publishing/steps/create_revision_directory.rb
spontaneous-0.2.0.beta9 lib/spontaneous/publishing/steps/create_revision_directory.rb
spontaneous-0.2.0.beta8 lib/spontaneous/publishing/steps/create_revision_directory.rb
spontaneous-0.2.0.beta7 lib/spontaneous/publishing/steps/create_revision_directory.rb
spontaneous-0.2.0.beta6 lib/spontaneous/publishing/steps/create_revision_directory.rb