Class: Wpcli::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(path = "") ⇒ Client

Returns a new instance of Client


3
4
5
# File 'lib/wpcli/client.rb', line 3

def initialize path = ""
  @path = path
end

Instance Method Details

#run(command) ⇒ Object


6
7
8
9
# File 'lib/wpcli/client.rb', line 6

def run command
  output = `wp#{@path.empty? ? " " : " --path=" + @path + " "}#{command}`
  parse output
end