Class: Nanoc::Deploying::Deployer Abstract Private

Inherits:
Object
  • Object
show all
Extended by:
DDPlugin::Plugin
Defined in:
lib/nanoc/deploying/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

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



33
34
35
36
37
# File 'lib/nanoc/deploying/deployer.rb', line 33

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



19
20
21
# File 'lib/nanoc/deploying/deployer.rb', line 19

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



23
24
25
# File 'lib/nanoc/deploying/deployer.rb', line 23

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.



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

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)


42
43
44
# File 'lib/nanoc/deploying/deployer.rb', line 42

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