Class: PressPass::Cli::NewProjectGenerator
- Inherits:
-
Object
- Object
- PressPass::Cli::NewProjectGenerator
- Defined in:
- lib/presspass/cli/new_project_generator.rb
Instance Method Summary collapse
-
#initialize(command = "new") ⇒ NewProjectGenerator
constructor
A new instance of NewProjectGenerator.
- #run ⇒ Object
Constructor Details
#initialize(command = "new") ⇒ NewProjectGenerator
Returns a new instance of NewProjectGenerator.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/presspass/cli/new_project_generator.rb', line 9 def initialize(command = "new") @options = {:php_port => 8000} @app_name = ARGV.first OptionParser.new do |opts| opts. = "Usage: presspass #{command} <app_name> [options]" opts.on("--port NUMBER", "Port to run PHP on") do |php_port| @options[:php_port] = php_port end end.parse!(ARGV) end |
Instance Method Details
#run ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/presspass/cli/new_project_generator.rb', line 25 def run create_project_directory download_wordpress extract_wordpress_into_project_directory install_foreman(php_port: @options[:php_port]) puts "WordPress installation created at #{@app_name}." puts "You can now run:" puts puts " $ gem install foreman" puts " $ cd #{@app_name}/" puts " $ foreman start" puts puts "And access your WordPress site at http://localhost:8000!" end |