Sha256: 4ad42045272d9b5c5640b4860ad58d43504b5ad342f73d52575ef828fa848d51

Contents?: true

Size: 1.38 KB

Versions: 55

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

module Nanoc::Deploying
  # Represents a deployer, an object that allows uploading the compiled site
  # to a specific (remote) location.
  #
  # @abstract Subclass and override {#run} to implement a custom filter.
  #
  # @api private
  class Deployer
    extend DDPlugin::Plugin

    # @return [String] The path to the directory that contains the files to
    #   upload. It should not have a trailing slash.
    attr_reader :source_path

    # @return [Hash] The deployer configuration
    attr_reader :config

    # @return [Boolean] true if the deployer should only show what would be
    #   deployed instead of doing the actual deployment
    attr_reader :dry_run
    alias dry_run? dry_run

    # @param [String] source_path The path to the directory that contains the
    #   files to upload. It should not have a trailing slash.
    #
    # @return [Hash] config The deployer configuration
    #
    # @param [Boolean] dry_run true if the deployer should
    #   only show what would be deployed instead actually deploying
    def initialize(source_path, config, dry_run: false)
      @source_path  = source_path
      @config       = config
      @dry_run      = dry_run
    end

    # Performs the actual deployment.
    #
    # @abstract
    def run
      raise NotImplementedError.new('Nanoc::Deploying::Deployer subclasses must implement #run')
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
nanoc-4.11.14 lib/nanoc/deploying/deployer.rb
nanoc-4.11.13 lib/nanoc/deploying/deployer.rb
nanoc-4.11.12 lib/nanoc/deploying/deployer.rb
nanoc-4.11.11 lib/nanoc/deploying/deployer.rb
nanoc-4.11.10 lib/nanoc/deploying/deployer.rb
nanoc-4.11.9 lib/nanoc/deploying/deployer.rb
nanoc-4.11.8 lib/nanoc/deploying/deployer.rb
nanoc-4.11.7 lib/nanoc/deploying/deployer.rb
nanoc-4.11.6 lib/nanoc/deploying/deployer.rb
nanoc-4.11.5 lib/nanoc/deploying/deployer.rb
nanoc-4.11.4 lib/nanoc/deploying/deployer.rb
nanoc-4.11.3 lib/nanoc/deploying/deployer.rb
nanoc-4.11.2 lib/nanoc/deploying/deployer.rb
nanoc-4.11.1 lib/nanoc/deploying/deployer.rb
nanoc-4.11.0 lib/nanoc/deploying/deployer.rb
nanoc-4.10.4 lib/nanoc/deploying/deployer.rb
nanoc-4.10.3 lib/nanoc/deploying/deployer.rb
nanoc-4.10.2 lib/nanoc/deploying/deployer.rb
nanoc-4.10.1 lib/nanoc/deploying/deployer.rb
nanoc-4.10.0 lib/nanoc/deploying/deployer.rb