Class: ZenPro::Commands::Create

Inherits:
Object
  • Object
show all
Defined in:
lib/zen_pro/commands/create.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Create

Returns a new instance of Create.



12
13
14
15
# File 'lib/zen_pro/commands/create.rb', line 12

def initialize(options)
  @app_name = options[:app_name]
  @project_configurations = options[:project_configurations]
end

Class Method Details

.run(options) ⇒ Object



8
9
10
# File 'lib/zen_pro/commands/create.rb', line 8

def self.run(options)
  new(options).execute
end

Instance Method Details

#executeObject



17
18
19
20
21
22
23
24
# File 'lib/zen_pro/commands/create.rb', line 17

def execute
  generate_rails_app
  run_bin_setup
rescue StandardError => e
  system! "rm -rf #{app_name}"

  raise e
end