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
139 140 141 142 143 |
# File 'lib/code42template/generators/app_generator.rb', line 139 def configure_app say 'Configuring app' build :add_puma_configuration end |
#create_code42_views ⇒ Object
135 136 137 |
# File 'lib/code42template/generators/app_generator.rb', line 135 def create_code42_views say 'Creating code42 views' end |
#create_heroku_apps ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/code42template/generators/app_generator.rb', line 86 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
79 80 81 82 83 84 |
# File 'lib/code42template/generators/app_generator.rb', line 79 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
153 154 155 156 157 |
# File 'lib/code42template/generators/app_generator.rb', line 153 def create_setup_script say 'Creating a setup script' build :create_setup_script end |
#customize_error_pages ⇒ Object
184 185 186 187 |
# File 'lib/code42template/generators/app_generator.rb', line 184 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
180 181 182 |
# File 'lib/code42template/generators/app_generator.rb', line 180 def init_git build :init_git end |
#setup_background_jobs ⇒ Object
73 74 75 76 77 |
# File 'lib/code42template/generators/app_generator.rb', line 73 def setup_background_jobs say 'Setting up background jobs' build :setup_background_jogs end |
#setup_continuous_integration ⇒ Object
125 126 127 128 129 |
# File 'lib/code42template/generators/app_generator.rb', line 125 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 70 71 |
# File 'lib/code42template/generators/app_generator.rb', line 61 def setup_database return if ['skip_active_record'] say 'Setting up database' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#setup_default_directories ⇒ Object
164 165 166 |
# File 'lib/code42template/generators/app_generator.rb', line 164 def setup_default_directories build :setup_default_directories end |
#setup_development_environment ⇒ Object
101 102 103 104 105 |
# File 'lib/code42template/generators/app_generator.rb', line 101 def setup_development_environment say 'Setting up the development environment' build :add_bullet_gem_configuration build :configure_quiet_assets end |
#setup_dotfiles ⇒ Object
159 160 161 162 |
# File 'lib/code42template/generators/app_generator.rb', line 159 def setup_dotfiles build :copy_dotfiles build :copy_eslint_config end |
#setup_git ⇒ Object
145 146 147 148 149 150 151 |
# File 'lib/code42template/generators/app_generator.rb', line 145 def setup_git if ![:skip_git] say "Initializing git" invoke :setup_default_directories invoke :init_git end end |
#setup_health_task ⇒ Object
174 175 176 177 178 |
# File 'lib/code42template/generators/app_generator.rb', line 174 def setup_health_task say "Setting up health task" build :setup_health_task end |
#setup_javascript ⇒ Object
194 195 196 197 198 199 |
# File 'lib/code42template/generators/app_generator.rb', line 194 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
115 116 117 118 119 |
# File 'lib/code42template/generators/app_generator.rb', line 115 def setup_production_environment say 'Setting up the production environment' build :remove_uglifier_js_compressor_config end |
#setup_secret_token ⇒ Object
131 132 133 |
# File 'lib/code42template/generators/app_generator.rb', line 131 def setup_secret_token say 'Moving secret token out of version control' end |
#setup_spring ⇒ Object
189 190 191 192 |
# File 'lib/code42template/generators/app_generator.rb', line 189 def setup_spring say "Springifying binstubs" build :setup_spring end |
#setup_staging_environment ⇒ Object
121 122 123 |
# File 'lib/code42template/generators/app_generator.rb', line 121 def setup_staging_environment say 'Setting up the staging environment' end |
#setup_test_environment ⇒ Object
107 108 109 110 111 112 113 |
# File 'lib/code42template/generators/app_generator.rb', line 107 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
168 169 170 171 172 |
# File 'lib/code42template/generators/app_generator.rb', line 168 def setup_webpack_tasks say "Setting up webpack tasks" build :setup_webpack_tasks end |