Class: Nanoc::Extra::Deployer Abstract
- Inherits:
-
Object
- Object
- Nanoc::Extra::Deployer
- Extended by:
- PluginRegistry::PluginMethods
- Defined in:
- lib/nanoc/extra/deployer.rb
Overview
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.
Direct Known Subclasses
Nanoc::Extra::Deployers::Fog, Nanoc::Extra::Deployers::Rsync
Instance Attribute Summary (collapse)
-
- (Hash) config
readonly
The deployer configuration.
-
- (Boolean) dry_run
(also: #dry_run?)
readonly
True if the deployer should only show what would be deployed instead of doing the actual deployment.
-
- (String) source_path
readonly
The path to the directory that contains the files to upload.
Instance Method Summary (collapse)
-
- (Hash) initialize(source_path, config, params = {})
constructor
Config The deployer configuration.
-
- (Object) run
abstract
Performs the actual deployment.
Methods included from PluginRegistry::PluginMethods
all, identifier, identifiers, named, register
Constructor Details
- (Hash) initialize(source_path, config, params = {})
Returns config The deployer configuration
30 31 32 33 34 |
# File 'lib/nanoc/extra/deployer.rb', line 30 def initialize(source_path, config, params = {}) @source_path = source_path @config = config @dry_run = params.fetch(:dry_run) { false } end |
Instance Attribute Details
- (Hash) config (readonly)
Returns The deployer configuration
16 17 18 |
# File 'lib/nanoc/extra/deployer.rb', line 16 def config @config end |
- (Boolean) dry_run (readonly) Also known as: dry_run?
Returns 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 |
- (String) source_path (readonly)
Returns 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
- (Object) run
Performs the actual deployment.
39 40 41 |
# File 'lib/nanoc/extra/deployer.rb', line 39 def run raise NotImplementedError.new('Nanoc::Extra::Deployer subclasses must implement #run') end |