Class: Nanoc::Extra::Deployer Abstract Private

Inherits:
Object
  • Object
show all
Extended by:
Int::PluginRegistry::PluginMethods
Defined in:
lib/nanoc/extra/deployer.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This class is abstract.

Subclass and override #run to implement a custom filter.

Represents a deployer, an object that allows uploading the compiled site to a specific (remote) location.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Int::PluginRegistry::PluginMethods

all, identifier, identifiers, named, register

Constructor Details

#initialize(source_path, config, dry_run: false) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns config The deployer configuration.

Parameters:

  • source_path (String)

    The path to the directory that contains the files to upload. It should not have a trailing slash.

  • dry_run (Boolean) (defaults to: false)

    true if the deployer should only show what would be deployed instead actually deploying



30
31
32
33
34
# File 'lib/nanoc/extra/deployer.rb', line 30

def initialize(source_path, config, dry_run: false)
  @source_path  = source_path
  @config       = config
  @dry_run      = dry_run
end

Instance Attribute Details

#configHash (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The deployer configuration.

Returns:

  • (Hash)

    The deployer configuration



16
17
18
# File 'lib/nanoc/extra/deployer.rb', line 16

def config
  @config
end

#dry_runBoolean (readonly) Also known as: dry_run?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns true if the deployer should only show what would be deployed instead of doing the actual deployment.

Returns:

  • (Boolean)

    true if the deployer should only show what would be deployed instead of doing the actual deployment



20
21
22
# File 'lib/nanoc/extra/deployer.rb', line 20

def dry_run
  @dry_run
end

#source_pathString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The path to the directory that contains the files to upload. It should not have a trailing slash.

Returns:

  • (String)

    The path to the directory that contains the files to upload. It should not have a trailing slash.



13
14
15
# File 'lib/nanoc/extra/deployer.rb', line 13

def source_path
  @source_path
end

Instance Method Details

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method is abstract.

Performs the actual deployment.

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/nanoc/extra/deployer.rb', line 39

def run
  raise NotImplementedError.new('Nanoc::Extra::Deployer subclasses must implement #run')
end