Class: Wordmove::Deployer::Base
- Inherits:
-
Object
- Object
- Wordmove::Deployer::Base
- Defined in:
- lib/wordmove/deployer/base.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #pull_db ⇒ Object
- #push_db ⇒ Object
- #remote_get_directory(directory) ⇒ Object
- #remote_put_directory(directory) ⇒ Object
Constructor Details
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
11 12 13 |
# File 'lib/wordmove/deployer/base.rb', line 11 def logger @logger end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/wordmove/deployer/base.rb', line 10 def @options end |
Class Method Details
.deployer_for(options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/wordmove/deployer/base.rb', line 13 def self.deployer_for() = fetch_movefile([:config]).merge() recursive_symbolize_keys!() if [:remote][:ftp] require 'wordmove/deployer/ftp' FTP.new() elsif [:remote][:ssh] require 'wordmove/deployer/ssh' SSH.new() else raise Thor::Error, "No valid adapter found." end end |
.fetch_movefile(path) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/wordmove/deployer/base.rb', line 27 def self.fetch_movefile(path) path ||= "Movefile" unless File.exists?(path) raise Thor::Error, "Could not find a valid Movefile" end YAML::load(File.open(path)) end |
Instance Method Details
#pull_db ⇒ Object
45 46 47 |
# File 'lib/wordmove/deployer/base.rb', line 45 def pull_db logger.task "Pulling Database" end |
#push_db ⇒ Object
41 42 43 |
# File 'lib/wordmove/deployer/base.rb', line 41 def push_db; logger.task "Pushing Database" end |
#remote_get_directory(directory) ⇒ Object
49 |
# File 'lib/wordmove/deployer/base.rb', line 49 def remote_get_directory(directory); end |
#remote_put_directory(directory) ⇒ Object
50 |
# File 'lib/wordmove/deployer/base.rb', line 50 def remote_put_directory(directory); end |