Class: Yupi::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Yupi::AppGenerator
- Defined in:
- lib/yupi/generators/app_generator.rb
Instance Method Summary collapse
- #add_root_route ⇒ Object
- #configure_app ⇒ Object
- #copy_miscellaneous_files ⇒ Object
- #create_heroku_apps ⇒ Object
- #create_yupi_views ⇒ Object
- #customize_error_pages ⇒ Object
- #customize_gemfile ⇒ Object
- #finish_template ⇒ Object
- #init_git ⇒ Object
- #outro ⇒ Object
- #remove_routes_comment_lines ⇒ Object
- #run_bin_setup ⇒ Object
- #setup_assets ⇒ Object
- #setup_bundler_audit ⇒ Object
- #setup_database ⇒ Object
- #setup_development_environment ⇒ Object
- #setup_git ⇒ Object
- #setup_gitignore ⇒ Object
- #setup_production_environment ⇒ Object
- #setup_secret_token ⇒ Object
- #setup_staging_environment ⇒ Object
- #setup_test_environment ⇒ Object
- #yupi_customization ⇒ Object
Instance Method Details
#add_root_route ⇒ Object
179 180 181 |
# File 'lib/yupi/generators/app_generator.rb', line 179 def add_root_route build :add_root_route end |
#configure_app ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/yupi/generators/app_generator.rb', line 112 def configure_app say 'Configuring app' build :setup_figaro build :configure_action_mailer build :configure_active_job build :configure_time_formats build :configure_rack_timeout build :configure_simple_form build :disable_xml_params build :fix_i18n_deprecation_warning build :setup_default_rake_task build :configure_puma build :setup_foreman end |
#copy_miscellaneous_files ⇒ Object
165 166 167 168 |
# File 'lib/yupi/generators/app_generator.rb', line 165 def copy_miscellaneous_files say 'Copying miscellaneous support files' build :copy_miscellaneous_files end |
#create_heroku_apps ⇒ Object
141 142 143 144 145 146 147 148 149 150 |
# File 'lib/yupi/generators/app_generator.rb', line 141 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 :provide_deploy_script end end |
#create_yupi_views ⇒ Object
105 106 107 108 109 110 |
# File 'lib/yupi/generators/app_generator.rb', line 105 def create_yupi_views say 'Creating yupi views' build :create_partials build :create_application_layout build :create_home_page end |
#customize_error_pages ⇒ Object
170 171 172 173 |
# File 'lib/yupi/generators/app_generator.rb', line 170 def customize_error_pages say 'Customizing the 500/404/422 pages' build :customize_error_pages end |
#customize_gemfile ⇒ Object
46 47 48 49 50 51 |
# File 'lib/yupi/generators/app_generator.rb', line 46 def customize_gemfile build :replace_gemfile build :set_ruby_to_version_being_used bundle_command 'install' end |
#finish_template ⇒ Object
21 22 23 24 25 |
# File 'lib/yupi/generators/app_generator.rb', line 21 def finish_template invoke :yupi_customization super invoke :run_bin_setup end |
#init_git ⇒ Object
161 162 163 |
# File 'lib/yupi/generators/app_generator.rb', line 161 def init_git build :init_git end |
#outro ⇒ Object
187 188 189 |
# File 'lib/yupi/generators/app_generator.rb', line 187 def outro say 'Congratulations! Now start creating a great app.' end |
#remove_routes_comment_lines ⇒ Object
175 176 177 |
# File 'lib/yupi/generators/app_generator.rb', line 175 def remove_routes_comment_lines build :remove_routes_comment_lines end |
#run_bin_setup ⇒ Object
183 184 185 |
# File 'lib/yupi/generators/app_generator.rb', line 183 def run_bin_setup build :run_bin_setup end |
#setup_assets ⇒ Object
127 128 129 130 131 |
# File 'lib/yupi/generators/app_generator.rb', line 127 def setup_assets say 'Set up assets' build :setup_stylesheets build :setup_javascripts end |
#setup_bundler_audit ⇒ Object
156 157 158 159 |
# File 'lib/yupi/generators/app_generator.rb', line 156 def setup_bundler_audit say "Setting up bundler-audit" build :setup_bundler_audit end |
#setup_database ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/yupi/generators/app_generator.rb', line 53 def setup_database say 'Setting up database' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#setup_development_environment ⇒ Object
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/yupi/generators/app_generator.rb', line 63 def setup_development_environment say 'Setting up the development environment' build :raise_on_delivery_errors build :set_test_delivery_method build :raise_on_unpermitted_parameters build :provide_setup_script build :provide_dev_prime_task build :configure_generators build :configure_i18n_for_missing_translations end |
#setup_git ⇒ Object
133 134 135 136 137 138 139 |
# File 'lib/yupi/generators/app_generator.rb', line 133 def setup_git if ![:skip_git] say 'Initializing git' invoke :setup_gitignore invoke :init_git end end |
#setup_gitignore ⇒ Object
152 153 154 |
# File 'lib/yupi/generators/app_generator.rb', line 152 def setup_gitignore build :gitignore_files end |
#setup_production_environment ⇒ Object
87 88 89 90 91 92 93 |
# File 'lib/yupi/generators/app_generator.rb', line 87 def setup_production_environment say 'Setting up the production environment' build :configure_newrelic build :configure_smtp build :enable_rack_deflater build :setup_asset_host end |
#setup_secret_token ⇒ Object
100 101 102 103 |
# File 'lib/yupi/generators/app_generator.rb', line 100 def setup_secret_token say 'Moving secret token out of version control' build :setup_secret_token end |
#setup_staging_environment ⇒ Object
95 96 97 98 |
# File 'lib/yupi/generators/app_generator.rb', line 95 def setup_staging_environment say 'Setting up the staging environment' build :setup_staging_environment end |
#setup_test_environment ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/yupi/generators/app_generator.rb', line 74 def setup_test_environment say 'Setting up the test environment' build :set_up_factory_girl_for_rspec build :generate_rspec build :configure_rspec build :configure_background_jobs_for_rspec build :enable_database_cleaner build :configure_spec_support_features build :configure_i18n_for_test_environment build :configure_i18n_tasks build :configure_action_mailer_in_specs end |
#yupi_customization ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/yupi/generators/app_generator.rb', line 27 def yupi_customization invoke :customize_gemfile invoke :setup_secret_token invoke :create_yupi_views invoke :configure_app invoke :setup_development_environment invoke :setup_test_environment invoke :setup_production_environment invoke :setup_assets invoke :copy_miscellaneous_files invoke :customize_error_pages invoke :remove_routes_comment_lines invoke :add_root_route invoke :setup_git invoke :setup_database invoke :setup_bundler_audit invoke :outro end |