Class: Code42Template::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Code42Template::AppGenerator
- Defined in:
- lib/code42template/generators/app_generator.rb
Instance Method Summary collapse
- #code42_customization ⇒ Object
- #configure_app ⇒ Object
- #create_code42_views ⇒ Object
- #create_heroku_apps ⇒ Object
- #create_local_heroku_setup ⇒ Object
- #create_setup_script ⇒ Object
- #customize_error_pages ⇒ Object
- #customize_gemfile ⇒ Object
- #finish_template ⇒ Object
- #init_git ⇒ Object
- #setup_background_jobs ⇒ Object
- #setup_continuous_integration ⇒ Object
- #setup_database ⇒ Object
- #setup_default_directories ⇒ Object
- #setup_development_environment ⇒ Object
- #setup_dotfiles ⇒ Object
- #setup_git ⇒ Object
- #setup_health_task ⇒ Object
- #setup_javascript ⇒ Object
- #setup_production_environment ⇒ Object
- #setup_secret_token ⇒ Object
- #setup_spring ⇒ Object
- #setup_staging_environment ⇒ Object
- #setup_test_environment ⇒ Object
- #setup_webpack_tasks ⇒ Object
Instance Method Details
#code42_customization ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/code42template/generators/app_generator.rb', line 32 def code42_customization invoke :customize_gemfile invoke :setup_development_environment invoke :setup_test_environment invoke :setup_production_environment invoke :setup_staging_environment invoke :setup_continuous_integration invoke :setup_secret_token invoke :create_code42_views invoke :configure_app invoke :customize_error_pages invoke :setup_dotfiles invoke :setup_git invoke :create_setup_script invoke :setup_database invoke :setup_background_jobs invoke :create_local_heroku_setup invoke :create_heroku_apps invoke :setup_webpack_tasks invoke :setup_spring invoke :setup_javascript end |
#configure_app ⇒ Object
137 138 139 140 141 |
# File 'lib/code42template/generators/app_generator.rb', line 137 def configure_app say 'Configuring app' build :add_puma_configuration end |
#create_code42_views ⇒ Object
133 134 135 |
# File 'lib/code42template/generators/app_generator.rb', line 133 def create_code42_views say 'Creating code42 views' end |
#create_heroku_apps ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/code42template/generators/app_generator.rb', line 84 def create_heroku_apps if [:heroku] say "Creating Heroku apps" build :create_heroku_apps, [:heroku_flags] build :set_heroku_serve_static_files build :set_heroku_remotes build :set_heroku_rails_secrets build :set_heroku_rails_environment build :set_heroku_application_host build :create_heroku_pipeline build :configure_heroku_buildpacks build :configure_automatic_deployment end end |
#create_local_heroku_setup ⇒ Object
77 78 79 80 81 82 |
# File 'lib/code42template/generators/app_generator.rb', line 77 def create_local_heroku_setup say "Creating local Heroku setup" build :create_review_apps_setup_script build :create_deploy_script build :update_readme_with_deploy end |
#create_setup_script ⇒ Object
151 152 153 154 155 |
# File 'lib/code42template/generators/app_generator.rb', line 151 def create_setup_script say 'Creating a setup script' build :create_setup_script end |
#customize_error_pages ⇒ Object
181 182 183 184 |
# File 'lib/code42template/generators/app_generator.rb', line 181 def customize_error_pages say 'Customizing the 500/404/422 pages' build :customize_error_pages end |
#customize_gemfile ⇒ Object
55 56 57 58 59 |
# File 'lib/code42template/generators/app_generator.rb', line 55 def customize_gemfile build :set_ruby_to_version_being_used bundle_command 'install' end |
#finish_template ⇒ Object
27 28 29 30 |
# File 'lib/code42template/generators/app_generator.rb', line 27 def finish_template invoke :code42_customization super end |
#init_git ⇒ Object
177 178 179 |
# File 'lib/code42template/generators/app_generator.rb', line 177 def init_git build :init_git end |
#setup_background_jobs ⇒ Object
71 72 73 74 75 |
# File 'lib/code42template/generators/app_generator.rb', line 71 def setup_background_jobs say 'Setting up background jobs' build :setup_background_jogs end |
#setup_continuous_integration ⇒ Object
123 124 125 126 127 |
# File 'lib/code42template/generators/app_generator.rb', line 123 def setup_continuous_integration say 'Setting up CI configuration' build :setup_continuous_integration end |
#setup_database ⇒ Object
61 62 63 64 65 66 67 68 69 |
# File 'lib/code42template/generators/app_generator.rb', line 61 def setup_database say 'Setting up database' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#setup_default_directories ⇒ Object
161 162 163 |
# File 'lib/code42template/generators/app_generator.rb', line 161 def setup_default_directories build :setup_default_directories end |
#setup_development_environment ⇒ Object
99 100 101 102 103 |
# File 'lib/code42template/generators/app_generator.rb', line 99 def setup_development_environment say 'Setting up the development environment' build :add_bullet_gem_configuration build :configure_quiet_assets end |
#setup_dotfiles ⇒ Object
157 158 159 |
# File 'lib/code42template/generators/app_generator.rb', line 157 def setup_dotfiles build :copy_dotfiles end |
#setup_git ⇒ Object
143 144 145 146 147 148 149 |
# File 'lib/code42template/generators/app_generator.rb', line 143 def setup_git if ![:skip_git] say "Initializing git" invoke :setup_default_directories invoke :init_git end end |
#setup_health_task ⇒ Object
171 172 173 174 175 |
# File 'lib/code42template/generators/app_generator.rb', line 171 def setup_health_task say "Setting up health task" build :setup_health_task end |
#setup_javascript ⇒ Object
191 192 193 194 195 196 |
# File 'lib/code42template/generators/app_generator.rb', line 191 def setup_javascript say "Setting up javascript environment with NPM and webpack" say "This will also run npm install, so hold on..." build :setup_javascript end |
#setup_production_environment ⇒ Object
113 114 115 116 117 |
# File 'lib/code42template/generators/app_generator.rb', line 113 def setup_production_environment say 'Setting up the production environment' build :remove_uglifier_js_compressor_config end |
#setup_secret_token ⇒ Object
129 130 131 |
# File 'lib/code42template/generators/app_generator.rb', line 129 def setup_secret_token say 'Moving secret token out of version control' end |
#setup_spring ⇒ Object
186 187 188 189 |
# File 'lib/code42template/generators/app_generator.rb', line 186 def setup_spring say "Springifying binstubs" build :setup_spring end |
#setup_staging_environment ⇒ Object
119 120 121 |
# File 'lib/code42template/generators/app_generator.rb', line 119 def setup_staging_environment say 'Setting up the staging environment' end |
#setup_test_environment ⇒ Object
105 106 107 108 109 110 111 |
# File 'lib/code42template/generators/app_generator.rb', line 105 def setup_test_environment say 'Setting up the test environment' build :setup_test_env_action_dispatch_exceptions build :copy_rspec_config build :configure_feature_tests end |
#setup_webpack_tasks ⇒ Object
165 166 167 168 169 |
# File 'lib/code42template/generators/app_generator.rb', line 165 def setup_webpack_tasks say "Setting up webpack tasks" build :setup_webpack_tasks end |