Class: Awestruct::CLI::Deploy
- Inherits:
-
Object
- Object
- Awestruct::CLI::Deploy
- Defined in:
- lib/awestruct/cli/deploy.rb
Instance Attribute Summary collapse
-
#deploy_config ⇒ Object
Returns the value of attribute deploy_config.
-
#site_config ⇒ Object
Returns the value of attribute site_config.
Instance Method Summary collapse
- #deploy_type ⇒ Object
-
#initialize(site_config, deploy_config) ⇒ Deploy
constructor
A new instance of Deploy.
- #run ⇒ Object
Constructor Details
#initialize(site_config, deploy_config) ⇒ Deploy
Returns a new instance of Deploy.
12 13 14 15 16 |
# File 'lib/awestruct/cli/deploy.rb', line 12 def initialize(site_config, deploy_config) @site_config = site_config @deploy_config = deploy_config deploy_config[:type] ||= (is_github? ? :github_pages : :rsync) end |
Instance Attribute Details
#deploy_config ⇒ Object
Returns the value of attribute deploy_config.
10 11 12 |
# File 'lib/awestruct/cli/deploy.rb', line 10 def deploy_config @deploy_config end |
#site_config ⇒ Object
Returns the value of attribute site_config.
9 10 11 |
# File 'lib/awestruct/cli/deploy.rb', line 9 def site_config @site_config end |
Instance Method Details
#deploy_type ⇒ Object
18 19 20 |
# File 'lib/awestruct/cli/deploy.rb', line 18 def deploy_type deploy_config[:type] end |
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/awestruct/cli/deploy.rb', line 22 def run() deployer_class = Awestruct::Deployers.instance[ deploy_type ] if ( deployer_class.nil? ) $stderr.puts "Unable to locate correct deployer for #{deploy_type}" return end deployer = deployer_class.new( site_config, deploy_config ) deployer.run end |