Class: DanarchyDeploy::Applicator::WordPress::WPCLI
- Inherits:
-
Object
- Object
- DanarchyDeploy::Applicator::WordPress::WPCLI
- Defined in:
- lib/danarchy_deploy/applicator/wordpress/wpcli.rb
Instance Method Summary collapse
- #check_update ⇒ Object
- #import ⇒ Object
-
#initialize(app, options) ⇒ WPCLI
constructor
A new instance of WPCLI.
- #install ⇒ Object
- #siteurl ⇒ Object
- #update ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(app, options) ⇒ WPCLI
Returns a new instance of WPCLI.
5 6 7 8 9 10 11 12 13 |
# File 'lib/danarchy_deploy/applicator/wordpress/wpcli.rb', line 5 def initialize(app, ) puts "\n > Initializing WordPress CLI" @database = app[:database] @prefix = app[:prefix] @path = app[:path] @user = app[:user] @options = wpcli_install end |
Instance Method Details
#check_update ⇒ Object
30 31 32 33 |
# File 'lib/danarchy_deploy/applicator/wordpress/wpcli.rb', line 30 def check_update cmd = @prefix + "'wp core check-update --path=#{@path}'" DanarchyDeploy::Helpers.run_command(cmd, @options) end |
#import ⇒ Object
46 47 48 49 |
# File 'lib/danarchy_deploy/applicator/wordpress/wpcli.rb', line 46 def import cmd = @prefix + "'wp db import #{@database[:backup]} --path=#{@path}'" DanarchyDeploy::Helpers.run_command(cmd, @options) end |
#install ⇒ Object
15 16 17 18 |
# File 'lib/danarchy_deploy/applicator/wordpress/wpcli.rb', line 15 def install cmd = @prefix + "'wp core download --path=#{@path}'" DanarchyDeploy::Helpers.run_command(cmd, @options) end |
#siteurl ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/danarchy_deploy/applicator/wordpress/wpcli.rb', line 35 def siteurl cmd = @prefix + "'wp option get siteurl --path=#{@path}'" siteurl = DanarchyDeploy::Helpers.run_command(cmd, @options) if siteurl[:stdout] return siteurl[:stdout].chomp else return siteurl[:stderr] end end |
#update ⇒ Object
20 21 22 23 |
# File 'lib/danarchy_deploy/applicator/wordpress/wpcli.rb', line 20 def update cmd = @prefix + "'wp core update --path=#{@path}'" DanarchyDeploy::Helpers.run_command(cmd, @options) end |
#version ⇒ Object
25 26 27 28 |
# File 'lib/danarchy_deploy/applicator/wordpress/wpcli.rb', line 25 def version cmd = @prefix + "'wp core version --path=#{@path}'" DanarchyDeploy::Helpers.run_command(cmd, @options) end |