Class: Wordmove::Doctor::Wpcli

Inherits:
Object
  • Object
show all
Defined in:
lib/wordmove/doctor/wpcli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWpcli

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

#loggerObject (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
# File 'lib/wordmove/doctor/wpcli.rb', line 10

def check!
  logger.task "Checking local wp-cli installation"

  if in_path? && up_to_date?
    logger.success "wp-cli is correctly installed and up to date"
  else
    logger.error "wp-cli is not installed (or not in your $PATH) or not up to date"
  end
end