Class: NetMate::Generators::CreateApplication
- Inherits:
-
Object
- Object
- NetMate::Generators::CreateApplication
- Defined in:
- lib/net_mate/create_application.rb
Instance Method Summary collapse
- #create_app ⇒ Object
-
#initialize(path) ⇒ CreateApplication
constructor
A new instance of CreateApplication.
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. path[0..(path.rindex('/'))] FileUtils.mkpath @app_path else @app_path = Dir.pwd end @app_name = path.split('/').last end |
Instance Method Details
#create_app ⇒ Object
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 |