Sha256: 54612ee074e1aeb9dbac4105e768df22c735504e88fc5a88a89305458c7e43c4

Contents?: true

Size: 776 Bytes

Versions: 3

Compression:

Stored size: 776 Bytes

Contents

require 'fileutils'

# Finalizes the release into a directory in target_path
# 
# The directory name will have the format PREFIX-VERSION
#
module HtmlMockup::Release::Finalizers
  class Dir < Base
    
    # @option options :prefix Prefix to put before the version (default = "html")
    def call(release, options = {})
      name = [(options[:prefix] || "html"), release.scm.version].join("-")
      
      release.log(self, "Finalizing release to #{release.target_path + name}")
      
      if File.exist?(release.target_path + name)
        release.log(self, "Removing existing target #{release.target_path + name}")
        FileUtils.rm_rf(release.target_path + name)
      end
      
      FileUtils.cp_r release.build_path, release.target_path + name
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
html_mockup-0.5.2 lib/html_mockup/release/finalizers/dir.rb
html_mockup-0.5.1 lib/html_mockup/release/finalizers/dir.rb
html_mockup-0.5.0 lib/html_mockup/release/finalizers/dir.rb