Class: WordPressTools::CLI

Inherits:
Thor
  • Object
show all
Includes:
CLIHelper
Defined in:
lib/wordpress_tools/cli.rb

Instance Method Summary collapse

Methods included from CLIHelper

#error, #executable_bit_command, #git_installed?, #info, #move_command, #run_command, #success, #unzip, #void, #warning

Instance Method Details

#new(dir_name = 'wordpress') ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/wordpress_tools/cli.rb', line 7

def new(dir_name = 'wordpress')
  if File.exist?(dir_name)
    say "Directory #{dir_name} already exists.", :red
    exit
  end

  info("Starting...")

  WPCLICore.new.invoke :install
  WPCLIServer.new.invoke :install
  Database.new.invoke :create, [dir_name], options
  WordPress.new.invoke :download, [dir_name], options
  WordPress.new.invoke :setup, [dir_name], options

  success("All done. Run 'wp server' inside '#{dir_name}' and visit '#{options[:site_url]}'")
end