Class: Wordmove::Doctor::Wpcli
- Inherits:
-
Object
- Object
- Wordmove::Doctor::Wpcli
- Defined in:
- lib/wordmove/doctor/wpcli.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #check! ⇒ Object
-
#initialize ⇒ Wpcli
constructor
A new instance of Wpcli.
Constructor Details
#initialize ⇒ Wpcli
Returns a new instance of Wpcli.
6 7 8 |
# File 'lib/wordmove/doctor/wpcli.rb', line 6 def initialize @logger = Logger.new(STDOUT).tap { |l| l.level = Logger::INFO } end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
4 5 6 |
# File 'lib/wordmove/doctor/wpcli.rb', line 4 def logger @logger end |
Instance Method Details
#check! ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/wordmove/doctor/wpcli.rb', line 10 def check! logger.task "Checking local wp-cli installation" if in_path? logger.success "wp-cli is correctly installed" if up_to_date? logger.success "wp-cli is up to date" else logger.error " wp-cli is not up to date.\n Use `wp cli update` to update to the latest version.\n LONG\n end\n else\n logger.error <<-LONG\n wp-cli is not installed (or not in your $PATH).\n Read http://wp-cli.org/#installing for installation info.\n LONG\n end\nend\n" |