Class: Hap::Generators::Install
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Hap::Generators::Install
- Includes:
- Helpers
- Defined in:
- lib/hap/generators/install.rb
Class Method Summary collapse
Instance Method Summary collapse
- #create_app_directory_structure ⇒ Object
- #create_remote_app ⇒ Object
- #init_git ⇒ Object
- #install_bundle ⇒ Object
Class Method Details
.source_root ⇒ Object
11 12 13 |
# File 'lib/hap/generators/install.rb', line 11 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#create_app_directory_structure ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/hap/generators/install.rb', line 15 def create_app_directory_structure directory("templates/app", path) empty_directory "#{app_path}/#{Hap::DEPLOYMENT_DIR}" empty_directory "#{app_path}/#{Hap::RUNTIME_DIR}" empty_directory "#{app_path}/app/endpoints" empty_directory "#{app_path}/config" Hap.app_root = app_path end |
#create_remote_app ⇒ Object
39 40 41 |
# File 'lib/hap/generators/install.rb', line 39 def create_remote_app create_app Hap::FRONT_END if [:remote] end |
#init_git ⇒ Object
33 34 35 36 37 |
# File 'lib/hap/generators/install.rb', line 33 def init_git inside(app_path) do git_init end end |
#install_bundle ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/hap/generators/install.rb', line 24 def install_bundle return unless [:bundle] inside(app_path) do Bundler.with_clean_env do run "bundle install", capture: true end end end |