Class: PressPass::Cli::NewProjectGenerator
- Inherits:
-
Object
- Object
- PressPass::Cli::NewProjectGenerator
- Defined in:
- lib/presspass/cli/new_project_generator.rb
Instance Method Summary collapse
- #init ⇒ Object
-
#initialize(command = "new") ⇒ NewProjectGenerator
constructor
A new instance of NewProjectGenerator.
- #run ⇒ Object
Constructor Details
#initialize(command = "new") ⇒ NewProjectGenerator
Returns a new instance of NewProjectGenerator.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/presspass/cli/new_project_generator.rb', line 8 def initialize(command = "new") @options = {:path_to_php => nil} @app_name = ARGV.first OptionParser.new do |opts| opts. = "Usage: presspass #{command} <app_name> [options]" opts.on("--php PATH", "Path to PHP binary") do |php_path| @options[:path_to_php] = php_path end end.parse!(ARGV) end |
Instance Method Details
#init ⇒ Object
36 37 38 39 40 |
# File 'lib/presspass/cli/new_project_generator.rb', line 36 def init add_rack_config(:path_to_php => @options[:path_to_php]) set_default_config end |
#run ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/presspass/cli/new_project_generator.rb', line 24 def run create_project_directory download_wordpress extract_wordpress_into_project_directory init puts "WordPress installation created at #{@app_name}." end |