Class: Suspenders::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Suspenders::AppGenerator
- Defined in:
- lib/voyage/generators/app_generator.rb,
lib/suspenders/generators/app_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #actually_setup_spring ⇒ Object
- #add_api_foundation ⇒ Object
- #add_app_css_file ⇒ Object
- #add_auto_annotate_models_rake_task ⇒ Object
- #add_favicon ⇒ Object
- #add_high_voltage_static_pages ⇒ Object
- #add_rubocop_config ⇒ Object
- #add_specs ⇒ Object
- #add_to_gitignore ⇒ Object
- #bon_voyage ⇒ Object
- #configure_app ⇒ Object
- #configure_rvm_prepend_bin_to_path ⇒ Object
- #copy_env_to_example ⇒ Object
- #copy_miscellaneous_files ⇒ Object
- #create_github_repo ⇒ Object
- #create_heroku_apps ⇒ Object
- #create_local_heroku_setup ⇒ Object
- #create_suspenders_views ⇒ Object
- #customize_application_js ⇒ Object
- #customize_application_mailer ⇒ Object
- #customize_error_pages ⇒ Object
- #customize_gemfile ⇒ Object
- #downgrade_neat_1_8_so_refills_media_mixin_works ⇒ Object
- #finish_template ⇒ Object
- #generate_data_migrations ⇒ Object
- #generate_default ⇒ Object
- #generate_refills ⇒ Object
- #generate_ruby_version_and_gemset ⇒ Object
- #generate_test_environment ⇒ Object
- #init_git ⇒ Object
- #install_devise ⇒ Object
- #outro ⇒ Object
- #overwrite_application_layout ⇒ Object
- #rake_db_setup ⇒ Object
- #remove_config_comment_lines ⇒ Object
- #remove_routes_comment_lines ⇒ Object
- #require_files_in_lib ⇒ Object
- #run_rubocop_auto_correct ⇒ 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_segment ⇒ Object
- #setup_spring ⇒ Object
- #setup_test_environment ⇒ Object
- #spin_up_webpacker ⇒ Object
- #suspenders_customization ⇒ Object
- #update_application_css_file ⇒ Object
- #update_delayed_job_migration_rails_5_1_specify_4_2 ⇒ Object
- #update_flashes_css_file ⇒ Object
- #update_gemset_in_gemfile ⇒ Object
- #update_test_environment ⇒ Object
- #use_slim ⇒ Object
Class Method Details
.accept_defaults ⇒ Object
20 21 22 |
# File 'lib/voyage/generators/app_generator.rb', line 20 def self.accept_defaults Suspenders::AppBuilder.new.accept_defaults end |
.banner ⇒ Object
236 237 238 |
# File 'lib/suspenders/generators/app_generator.rb', line 236 def self. "suspenders #{arguments.map(&:usage).join(' ')} [options]" end |
.preflight_check ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/voyage/generators/app_generator.rb', line 10 def self.preflight_check puts '"bundle install" will be run for the current ruby version and gemset. Press enter to continue...' prompt = STDIN.gets.chomp unless prompt.empty? puts "Skipping install. Please create a ruby gemset first!" exit 1 end end |
.start ⇒ Object
3 4 5 6 7 8 |
# File 'lib/voyage/generators/app_generator.rb', line 3 def self.start preflight_check accept_defaults super end |
Instance Method Details
#actually_setup_spring ⇒ Object
183 184 185 186 |
# File 'lib/voyage/generators/app_generator.rb', line 183 def actually_setup_spring say "Springifying binstubs" build :setup_spring end |
#add_api_foundation ⇒ Object
155 156 157 |
# File 'lib/voyage/generators/app_generator.rb', line 155 def add_api_foundation build :add_api_foundation end |
#add_app_css_file ⇒ Object
103 104 105 |
# File 'lib/voyage/generators/app_generator.rb', line 103 def add_app_css_file build :add_app_css_file end |
#add_auto_annotate_models_rake_task ⇒ Object
131 132 133 |
# File 'lib/voyage/generators/app_generator.rb', line 131 def add_auto_annotate_models_rake_task build :add_auto_annotate_models_rake_task end |
#add_favicon ⇒ Object
139 140 141 |
# File 'lib/voyage/generators/app_generator.rb', line 139 def add_favicon build :add_favicon end |
#add_high_voltage_static_pages ⇒ Object
91 92 93 |
# File 'lib/voyage/generators/app_generator.rb', line 91 def add_high_voltage_static_pages build :add_high_voltage_static_pages end |
#add_rubocop_config ⇒ Object
127 128 129 |
# File 'lib/voyage/generators/app_generator.rb', line 127 def add_rubocop_config build :add_rubocop_config end |
#add_specs ⇒ Object
147 148 149 |
# File 'lib/voyage/generators/app_generator.rb', line 147 def add_specs build :add_specs end |
#add_to_gitignore ⇒ Object
179 180 181 |
# File 'lib/voyage/generators/app_generator.rb', line 179 def add_to_gitignore build :add_to_gitignore end |
#bon_voyage ⇒ Object
193 194 195 196 |
# File 'lib/voyage/generators/app_generator.rb', line 193 def bon_voyage say 'Congratulations! You just pulled our suspenders, Headway style!' say honeybadger_outro end |
#configure_app ⇒ Object
134 135 136 137 138 139 140 141 142 143 |
# File 'lib/suspenders/generators/app_generator.rb', line 134 def configure_app say 'Configuring app' build :configure_action_mailer build :configure_active_job build :configure_time_formats build :setup_default_rake_task build :replace_default_puma_configuration build :set_up_forego build :setup_rack_mini_profiler end |
#configure_rvm_prepend_bin_to_path ⇒ Object
163 164 165 |
# File 'lib/voyage/generators/app_generator.rb', line 163 def configure_rvm_prepend_bin_to_path build :configure_rvm_prepend_bin_to_path end |
#copy_env_to_example ⇒ Object
175 176 177 |
# File 'lib/voyage/generators/app_generator.rb', line 175 def copy_env_to_example build :copy_env_to_example end |
#copy_miscellaneous_files ⇒ Object
207 208 209 210 |
# File 'lib/suspenders/generators/app_generator.rb', line 207 def copy_miscellaneous_files say 'Copying miscellaneous support files' build :copy_miscellaneous_files end |
#create_github_repo ⇒ Object
173 174 175 176 177 178 |
# File 'lib/suspenders/generators/app_generator.rb', line 173 def create_github_repo if ![:skip_git] && [:github] say 'Creating Github repo' build :create_github_repo, [:github] end end |
#create_heroku_apps ⇒ Object
160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/suspenders/generators/app_generator.rb', line 160 def create_heroku_apps if [:heroku] say "Creating Heroku apps" build :create_heroku_apps, [:heroku_flags] build :set_heroku_remotes build :set_heroku_rails_secrets build :set_heroku_application_host build :set_heroku_backup_schedule build :create_heroku_pipeline build :configure_automatic_deployment end end |
#create_local_heroku_setup ⇒ Object
153 154 155 156 157 158 |
# File 'lib/suspenders/generators/app_generator.rb', line 153 def create_local_heroku_setup say "Creating local Heroku setup" build :create_review_apps_setup_script build :create_deploy_script build :create_heroku_application_manifest_file end |
#create_suspenders_views ⇒ Object
125 126 127 128 129 130 131 132 |
# File 'lib/suspenders/generators/app_generator.rb', line 125 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_application_js ⇒ Object
75 76 77 |
# File 'lib/voyage/generators/app_generator.rb', line 75 def customize_application_js build :customize_application_js end |
#customize_application_mailer ⇒ Object
143 144 145 |
# File 'lib/voyage/generators/app_generator.rb', line 143 def customize_application_mailer build :customize_application_mailer end |
#customize_error_pages ⇒ Object
212 213 214 215 |
# File 'lib/suspenders/generators/app_generator.rb', line 212 def customize_error_pages say 'Customizing the 500/404/422 pages' build :customize_error_pages end |
#customize_gemfile ⇒ Object
62 63 64 65 66 67 |
# File 'lib/suspenders/generators/app_generator.rb', line 62 def customize_gemfile build :replace_gemfile, [:path] build :set_ruby_to_version_being_used bundle_command 'install' build :configure_simple_form end |
#downgrade_neat_1_8_so_refills_media_mixin_works ⇒ Object
95 96 97 |
# File 'lib/voyage/generators/app_generator.rb', line 95 def downgrade_neat_1_8_so_refills_media_mixin_works build :downgrade_neat_1_8_so_refills_media_mixin_works end |
#finish_template ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/voyage/generators/app_generator.rb', line 24 def finish_template invoke :suspenders_customization invoke :update_gemset_in_gemfile invoke :use_slim invoke :install_devise invoke :customize_application_js invoke :require_files_in_lib invoke :generate_ruby_version_and_gemset invoke :generate_data_migrations invoke :add_high_voltage_static_pages invoke :downgrade_neat_1_8_so_refills_media_mixin_works # this should be temporary until they get refills re-written to take advantage of Neat 2.0 invoke :generate_refills invoke :add_app_css_file invoke :update_flashes_css_file invoke :update_application_css_file invoke :overwrite_application_layout invoke :generate_test_environment invoke :update_test_environment invoke :add_rubocop_config invoke :add_auto_annotate_models_rake_task invoke :update_delayed_job_migration_rails_5_1_specify_4_2 invoke :add_favicon invoke :customize_application_mailer invoke :add_specs # Do these last invoke :add_api_foundation invoke :rake_db_setup invoke :configure_rvm_prepend_bin_to_path invoke :run_rubocop_auto_correct invoke :copy_env_to_example invoke :add_to_gitignore invoke :spin_up_webpacker invoke :actually_setup_spring invoke :bon_voyage super end |
#generate_data_migrations ⇒ Object
87 88 89 |
# File 'lib/voyage/generators/app_generator.rb', line 87 def generate_data_migrations build :generate_data_migrations end |
#generate_default ⇒ Object
225 226 227 228 229 |
# File 'lib/suspenders/generators/app_generator.rb', line 225 def generate_default run("spring stop") generate("suspenders:static") generate("suspenders:stylesheet_base") end |
#generate_refills ⇒ Object
99 100 101 |
# File 'lib/voyage/generators/app_generator.rb', line 99 def generate_refills build :generate_refills end |
#generate_ruby_version_and_gemset ⇒ Object
83 84 85 |
# File 'lib/voyage/generators/app_generator.rb', line 83 def generate_ruby_version_and_gemset build :generate_ruby_version_and_gemset end |
#generate_test_environment ⇒ Object
119 120 121 |
# File 'lib/voyage/generators/app_generator.rb', line 119 def generate_test_environment build :generate_test_environment end |
#init_git ⇒ Object
203 204 205 |
# File 'lib/suspenders/generators/app_generator.rb', line 203 def init_git build :init_git end |
#install_devise ⇒ Object
71 72 73 |
# File 'lib/voyage/generators/app_generator.rb', line 71 def install_devise build :install_devise end |
#outro ⇒ Object
188 189 190 191 |
# File 'lib/voyage/generators/app_generator.rb', line 188 def outro # need this to be nothing so it doesn't output any text when # :suspenders_customization runs and it invokes this method end |
#overwrite_application_layout ⇒ Object
115 116 117 |
# File 'lib/voyage/generators/app_generator.rb', line 115 def overwrite_application_layout build :overwrite_application_layout end |
#rake_db_setup ⇒ Object
159 160 161 |
# File 'lib/voyage/generators/app_generator.rb', line 159 def rake_db_setup build :rake_db_setup end |
#remove_config_comment_lines ⇒ Object
217 218 219 |
# File 'lib/suspenders/generators/app_generator.rb', line 217 def remove_config_comment_lines build :remove_config_comment_lines end |
#remove_routes_comment_lines ⇒ Object
221 222 223 |
# File 'lib/suspenders/generators/app_generator.rb', line 221 def remove_routes_comment_lines build :remove_routes_comment_lines end |
#require_files_in_lib ⇒ Object
79 80 81 |
# File 'lib/voyage/generators/app_generator.rb', line 79 def require_files_in_lib build :require_files_in_lib end |
#run_rubocop_auto_correct ⇒ Object
171 172 173 |
# File 'lib/voyage/generators/app_generator.rb', line 171 def run_rubocop_auto_correct build :run_rubocop_auto_correct end |
#setup_bundler_audit ⇒ Object
193 194 195 196 |
# File 'lib/suspenders/generators/app_generator.rb', line 193 def setup_bundler_audit say "Setting up bundler-audit" build :setup_bundler_audit end |
#setup_database ⇒ Object
69 70 71 72 73 74 75 76 77 |
# File 'lib/suspenders/generators/app_generator.rb', line 69 def setup_database say 'Setting up database' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#setup_default_directories ⇒ Object
189 190 191 |
# File 'lib/suspenders/generators/app_generator.rb', line 189 def setup_default_directories build :setup_default_directories end |
#setup_development_environment ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/suspenders/generators/app_generator.rb', line 79 def setup_development_environment say 'Setting up the development environment' build :raise_on_missing_assets_in_test build :raise_on_delivery_errors build :remove_turbolinks 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
185 186 187 |
# File 'lib/suspenders/generators/app_generator.rb', line 185 def setup_dotfiles build :copy_dotfiles end |
#setup_git ⇒ Object
145 146 147 148 149 150 151 |
# File 'lib/suspenders/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_production_environment ⇒ Object
111 112 113 114 115 116 117 118 |
# File 'lib/suspenders/generators/app_generator.rb', line 111 def setup_production_environment say 'Setting up the production environment' build :configure_smtp build :configure_rack_timeout build :enable_rack_canonical_host build :enable_rack_deflater build :setup_asset_host end |
#setup_secret_token ⇒ Object
120 121 122 123 |
# File 'lib/suspenders/generators/app_generator.rb', line 120 def setup_secret_token say 'Moving secret token out of version control' build :setup_secret_token end |
#setup_segment ⇒ Object
180 181 182 183 |
# File 'lib/suspenders/generators/app_generator.rb', line 180 def setup_segment say 'Setting up Segment' build :setup_segment end |
#setup_spring ⇒ Object
167 168 169 |
# File 'lib/voyage/generators/app_generator.rb', line 167 def setup_spring # do nothing so we can run generators after suspenders_customization runs end |
#setup_test_environment ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/suspenders/generators/app_generator.rb', line 94 def setup_test_environment say 'Setting up the test environment' build :set_up_factory_girl_for_rspec build :generate_factories_file build :set_up_hound build :generate_rspec build :configure_rspec build :configure_background_jobs_for_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 |
#spin_up_webpacker ⇒ Object
151 152 153 |
# File 'lib/voyage/generators/app_generator.rb', line 151 def spin_up_webpacker build :spin_up_webpacker end |
#suspenders_customization ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/suspenders/generators/app_generator.rb', line 37 def suspenders_customization invoke :customize_gemfile invoke :setup_development_environment invoke :setup_test_environment invoke :setup_production_environment invoke :setup_secret_token invoke :create_suspenders_views invoke :configure_app 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_local_heroku_setup invoke :create_heroku_apps invoke :create_github_repo invoke :setup_segment invoke :setup_bundler_audit invoke :setup_spring invoke :generate_default invoke :outro end |
#update_application_css_file ⇒ Object
111 112 113 |
# File 'lib/voyage/generators/app_generator.rb', line 111 def update_application_css_file build :update_application_css_file end |
#update_delayed_job_migration_rails_5_1_specify_4_2 ⇒ Object
135 136 137 |
# File 'lib/voyage/generators/app_generator.rb', line 135 def update_delayed_job_migration_rails_5_1_specify_4_2 build :update_delayed_job_migration_rails_5_1_specify_4_2 end |
#update_flashes_css_file ⇒ Object
107 108 109 |
# File 'lib/voyage/generators/app_generator.rb', line 107 def update_flashes_css_file build :update_flashes_css_file end |
#update_gemset_in_gemfile ⇒ Object
63 64 65 |
# File 'lib/voyage/generators/app_generator.rb', line 63 def update_gemset_in_gemfile build :update_gemset_in_gemfile end |
#update_test_environment ⇒ Object
123 124 125 |
# File 'lib/voyage/generators/app_generator.rb', line 123 def update_test_environment build :update_test_environment end |
#use_slim ⇒ Object
67 68 69 |
# File 'lib/voyage/generators/app_generator.rb', line 67 def use_slim build :use_slim end |