Class: NetMate::Generators::CreateApplication

Inherits:
Object
  • Object
show all
Defined in:
lib/net_mate/create_application.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ CreateApplication

Returns a new instance of CreateApplication.



10
11
12
13
14
15
16
17
18
# File 'lib/net_mate/create_application.rb', line 10

def initialize path
  if path.include? '/'
    @app_path = File.expand_path path[0..(path.rindex('/'))]        
    FileUtils.mkpath @app_path
  else
    @app_path = Dir.pwd
  end
  @app_name = path.split('/').last
end

Instance Method Details

#create_appObject



20
21
22
23
24
25
26
27
28
# File 'lib/net_mate/create_application.rb', line 20

def create_app
  create_skeleton
  write_config_files      
  write_html_pages
  display_output
  puts 'Installing required gems'
  command = "cd #{@app_path}/#{@app_name} && bundle install"
  exec command
end