Class: Roger::Release::Finalizers::Dir
- Defined in:
- lib/roger/release/finalizers/dir.rb
Overview
Finalizes the release into a directory in target_path
The directory name will have the format PREFIX-VERSION
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Roger::Release::Finalizers::Base
Instance Method Details
#call(release, call_options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/roger/release/finalizers/dir.rb', line 10 def call(release, = {}) = { prefix: "html", target_path: release.target_path }.update(@options) .update() if name = [[:prefix], release.scm.version].join("-") target_dir = Pathname.new([:target_path]) FileUtils.mkdir_p(target_dir) unless target_dir.exist? target_path = target_dir + name release.log(self, "Finalizing release to #{target_path}") if File.exist?(target_path) release.log(self, "Removing existing target #{target_path}") FileUtils.rm_rf(target_path) end FileUtils.cp_r release.build_path, target_path end |