Class: Suspenders::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Suspenders::AppGenerator
- Defined in:
- lib/suspenders/generators/app_generator.rb
Instance Method Summary collapse
- #configure_app ⇒ Object
- #copy_miscellaneous_files ⇒ Object
- #create_github_repo ⇒ Object
- #create_heroku_apps ⇒ Object
- #create_suspenders_views ⇒ Object
- #customize_error_pages ⇒ Object
- #customize_gemfile ⇒ Object
- #finish_template ⇒ Object
- #init_git ⇒ Object
- #outro ⇒ Object
- #remove_config_comment_lines ⇒ Object
- #remove_routes_comment_lines ⇒ Object
- #setup_bundler_audit ⇒ Object
- #setup_database ⇒ Object
- #setup_default_directories ⇒ Object
- #setup_development_environment ⇒ Object
- #setup_dotfiles ⇒ Object
- #setup_git ⇒ Object
- #setup_production_environment ⇒ Object
- #setup_secret_token ⇒ Object
- #setup_spring ⇒ Object
- #setup_staging_environment ⇒ Object
- #setup_stylesheets ⇒ Object
- #setup_test_environment ⇒ Object
- #suspenders_customization ⇒ Object
Instance Method Details
#configure_app ⇒ Object
136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/suspenders/generators/app_generator.rb', line 136 def configure_app say 'Configuring app' build :configure_action_mailer build :configure_active_job build :configure_time_formats build :disable_xml_params build :setup_default_rake_task build :configure_puma build :set_up_forego build :setup_rack_mini_profiler end |
#copy_miscellaneous_files ⇒ Object
205 206 207 208 |
# File 'lib/suspenders/generators/app_generator.rb', line 205 def copy_miscellaneous_files say 'Copying miscellaneous support files' build :copy_miscellaneous_files end |
#create_github_repo ⇒ Object
176 177 178 179 180 181 |
# File 'lib/suspenders/generators/app_generator.rb', line 176 def create_github_repo if ![:skip_git] && [:github] say 'Creating Github repo' build :create_github_repo, [:github] end end |
#create_heroku_apps ⇒ Object
161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/suspenders/generators/app_generator.rb', line 161 def create_heroku_apps if [:heroku] say "Creating Heroku apps" build :create_heroku_apps, [:heroku_flags] build :provide_review_apps_setup_script build :set_heroku_serve_static_files build :set_heroku_remotes build :set_heroku_rails_secrets build :create_heroku_pipelines_config_file build :create_heroku_pipeline build :provide_deploy_script build :configure_automatic_deployment end end |
#create_suspenders_views ⇒ Object
127 128 129 130 131 132 133 134 |
# File 'lib/suspenders/generators/app_generator.rb', line 127 def create_suspenders_views say 'Creating suspenders views' build :create_partials_directory build :create_shared_flashes build :create_shared_javascripts build :create_shared_css_overrides build :create_application_layout end |
#customize_error_pages ⇒ Object
210 211 212 213 |
# File 'lib/suspenders/generators/app_generator.rb', line 210 def customize_error_pages say 'Customizing the 500/404/422 pages' build :customize_error_pages end |
#customize_gemfile ⇒ Object
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/suspenders/generators/app_generator.rb', line 56 def customize_gemfile build :set_ruby_to_version_being_used if [:heroku] build :set_up_heroku_specific_gems end bundle_command 'install' build :configure_simple_form end |
#finish_template ⇒ Object
27 28 29 30 |
# File 'lib/suspenders/generators/app_generator.rb', line 27 def finish_template invoke :suspenders_customization super end |
#init_git ⇒ Object
201 202 203 |
# File 'lib/suspenders/generators/app_generator.rb', line 201 def init_git build :init_git end |
#outro ⇒ Object
223 224 225 |
# File 'lib/suspenders/generators/app_generator.rb', line 223 def outro say 'Congratulations! You just pulled our suspenders.' end |
#remove_config_comment_lines ⇒ Object
215 216 217 |
# File 'lib/suspenders/generators/app_generator.rb', line 215 def remove_config_comment_lines build :remove_config_comment_lines end |
#remove_routes_comment_lines ⇒ Object
219 220 221 |
# File 'lib/suspenders/generators/app_generator.rb', line 219 def remove_routes_comment_lines build :remove_routes_comment_lines end |
#setup_bundler_audit ⇒ Object
191 192 193 194 |
# File 'lib/suspenders/generators/app_generator.rb', line 191 def setup_bundler_audit say "Setting up bundler-audit" build :setup_bundler_audit end |
#setup_database ⇒ Object
67 68 69 70 71 72 73 74 75 |
# File 'lib/suspenders/generators/app_generator.rb', line 67 def setup_database say 'Setting up database' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#setup_default_directories ⇒ Object
187 188 189 |
# File 'lib/suspenders/generators/app_generator.rb', line 187 def setup_default_directories build :setup_default_directories end |
#setup_development_environment ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/suspenders/generators/app_generator.rb', line 77 def setup_development_environment say 'Setting up the development environment' build :raise_on_missing_assets_in_test build :raise_on_delivery_errors build :set_test_delivery_method build :add_bullet_gem_configuration build :raise_on_unpermitted_parameters build :provide_setup_script build :provide_dev_prime_task build :configure_generators build :configure_i18n_for_missing_translations build :configure_quiet_assets end |
#setup_dotfiles ⇒ Object
183 184 185 |
# File 'lib/suspenders/generators/app_generator.rb', line 183 def setup_dotfiles build :copy_dotfiles end |
#setup_git ⇒ Object
153 154 155 156 157 158 159 |
# File 'lib/suspenders/generators/app_generator.rb', line 153 def setup_git if ![:skip_git] say "Initializing git" invoke :setup_default_directories invoke :init_git end end |
#setup_production_environment ⇒ Object
106 107 108 109 110 111 112 113 114 115 |
# File 'lib/suspenders/generators/app_generator.rb', line 106 def setup_production_environment say 'Setting up the production environment' build :configure_newrelic build :configure_smtp build :configure_rack_timeout build :enable_rack_canonical_host build :enable_rack_deflater build :enable_rack_tracker build :setup_asset_host end |
#setup_secret_token ⇒ Object
122 123 124 125 |
# File 'lib/suspenders/generators/app_generator.rb', line 122 def setup_secret_token say 'Moving secret token out of version control' build :setup_secret_token end |
#setup_spring ⇒ Object
196 197 198 199 |
# File 'lib/suspenders/generators/app_generator.rb', line 196 def setup_spring say "Springifying binstubs" build :setup_spring end |
#setup_staging_environment ⇒ Object
117 118 119 120 |
# File 'lib/suspenders/generators/app_generator.rb', line 117 def setup_staging_environment say 'Setting up the staging environment' build :setup_staging_environment end |
#setup_stylesheets ⇒ Object
148 149 150 151 |
# File 'lib/suspenders/generators/app_generator.rb', line 148 def setup_stylesheets say 'Set up stylesheets' build :setup_stylesheets end |
#setup_test_environment ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/suspenders/generators/app_generator.rb', line 91 def setup_test_environment say 'Setting up the test environment' build :set_up_factory_girl_for_rspec build :generate_factories_file build :generate_rspec build :configure_rspec build :enable_database_cleaner build :provide_shoulda_matchers_config build :configure_spec_support_features build :configure_ci build :configure_i18n_for_test_environment build :configure_action_mailer_in_specs build :configure_capybara_webkit end |
#suspenders_customization ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/suspenders/generators/app_generator.rb', line 32 def suspenders_customization invoke :customize_gemfile invoke :setup_development_environment invoke :setup_test_environment invoke :setup_production_environment invoke :setup_staging_environment invoke :setup_secret_token invoke :create_suspenders_views invoke :configure_app invoke :setup_stylesheets invoke :copy_miscellaneous_files invoke :customize_error_pages invoke :remove_config_comment_lines invoke :remove_routes_comment_lines invoke :setup_dotfiles invoke :setup_git invoke :setup_database invoke :create_heroku_apps invoke :create_github_repo invoke :setup_bundler_audit invoke :setup_spring invoke :outro end |