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
32 33 34 35 36 |
# File 'lib/nanoc/extra/deployer.rb', line 32 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
18 19 20 |
# File 'lib/nanoc/extra/deployer.rb', line 18 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
22 23 24 |
# File 'lib/nanoc/extra/deployer.rb', line 22 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.
15 16 17 |
# File 'lib/nanoc/extra/deployer.rb', line 15 def source_path @source_path end |
Instance Method Details
- (Object) run
Performs the actual deployment.
41 42 43 |
# File 'lib/nanoc/extra/deployer.rb', line 41 def run raise NotImplementedError.new('Nanoc::Extra::Deployer subclasses must implement #run') end |