cybele 1.9.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.fasterer.yml +5 -0
- data/.flayignore +3 -0
- data/.gitignore +4 -1
- data/.haml-lint.yml +5 -0
- data/.poper.yml +7 -0
- data/.rubocop.yml +59 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +458 -2
- data/Gemfile +2 -0
- data/README.md +16 -20
- data/Rakefile +1 -1
- data/USAGE +12 -0
- data/bin/build_app +18 -0
- data/bin/build_gem +20 -0
- data/bin/cybele +21 -6
- data/config.reek +29 -0
- data/cybele.gemspec +14 -6
- data/example.pronto.yml +8 -0
- data/lib/cybele.rb +33 -0
- data/lib/cybele/app_builder.rb +43 -510
- data/lib/cybele/generators/app_generator.rb +240 -180
- data/lib/cybele/helpers.rb +104 -0
- data/lib/cybele/helpers/app_files/assets_files.rb +43 -0
- data/lib/cybele/helpers/app_files/controller_files.rb +23 -0
- data/lib/cybele/helpers/app_files/helper_files.rb +15 -0
- data/lib/cybele/helpers/app_files/mailer_files.rb +15 -0
- data/lib/cybele/helpers/app_files/model_files.rb +16 -0
- data/lib/cybele/helpers/app_files/vendor_files.rb +14 -0
- data/lib/cybele/helpers/app_files/view_files.rb +62 -0
- data/lib/cybele/helpers/app_files/view_gems.rb +20 -0
- data/lib/cybele/helpers/audited.rb +12 -0
- data/lib/cybele/helpers/basic_authentication.rb +44 -0
- data/lib/cybele/helpers/devise.rb +67 -0
- data/lib/cybele/helpers/docker.rb +53 -0
- data/lib/cybele/helpers/dotenv.rb +23 -0
- data/lib/cybele/helpers/error_pages.rb +37 -0
- data/lib/cybele/helpers/general.rb +87 -0
- data/lib/cybele/helpers/haml.rb +18 -0
- data/lib/cybele/helpers/locale_language.rb +23 -0
- data/lib/cybele/helpers/mailer.rb +25 -0
- data/lib/cybele/helpers/paperclip.rb +33 -0
- data/lib/cybele/helpers/pronto.rb +34 -0
- data/lib/cybele/helpers/recipient_interceptor.rb +18 -0
- data/lib/cybele/helpers/responders.rb +36 -0
- data/lib/cybele/helpers/routes.rb +18 -0
- data/lib/cybele/helpers/show_for.rb +20 -0
- data/lib/cybele/helpers/sidekiq.rb +37 -0
- data/lib/cybele/helpers/simple_form.rb +19 -0
- data/lib/cybele/helpers/staging.rb +15 -0
- data/lib/cybele/version.rb +5 -3
- data/spec/features/cli_help_spec.rb +42 -0
- data/spec/features/git_and_git_flow_spec.rb +30 -0
- data/spec/features/new_default_project_spec.rb +465 -0
- data/spec/features/new_not_default_project_spec.rb +412 -0
- data/spec/spec_helper.rb +38 -0
- data/spec/support/config_test_helper.rb +36 -0
- data/spec/support/cybele_test_helpers.rb +115 -0
- data/spec/support/devise_test_helper.rb +45 -0
- data/spec/support/dotenv_test_helper.rb +31 -0
- data/spec/support/error_pages_test_helper.rb +24 -0
- data/spec/support/force_ssl_test_helper.rb +24 -0
- data/spec/support/git_ignore_test_helper.rb +10 -0
- data/spec/support/locale_language_test_helper.rb +43 -0
- data/spec/support/mail_test_helpers.rb +15 -0
- data/spec/support/paperclip_test_helper.rb +38 -0
- data/spec/support/pronto_test_helpers.rb +41 -0
- data/spec/support/responder_test_helper.rb +32 -0
- data/templates/Gemfile.erb +59 -0
- data/templates/README.md.erb +23 -20
- data/templates/VERSION.txt +1 -0
- data/templates/app_files/app/assets/javascripts/application.js +81 -0
- data/templates/app_files/app/assets/javascripts/hq/application.js +80 -0
- data/templates/{app/assets/stylesheets/application.css.sass → app_files/app/assets/stylesheets/application.sass} +27 -16
- data/templates/app_files/app/assets/stylesheets/hq/_sidebar.sass +89 -0
- data/templates/app_files/app/assets/stylesheets/hq/application.sass +74 -0
- data/templates/app_files/app/controllers/concerns/activatable.rb +16 -0
- data/templates/{app → app_files/app}/controllers/hq/admins_controller.rb +7 -10
- data/templates/app_files/app/controllers/hq/application_controller.rb +13 -0
- data/templates/{app → app_files/app}/controllers/hq/audits_controller.rb +3 -3
- data/templates/app_files/app/controllers/hq/dashboard_controller.rb +7 -0
- data/templates/{app → app_files/app}/controllers/hq/passwords_controller.rb +3 -2
- data/templates/app_files/app/controllers/hq/registrations_controller.rb +22 -0
- data/templates/{app → app_files/app}/controllers/hq/sessions_controller.rb +5 -4
- data/templates/{app → app_files/app}/controllers/hq/users_controller.rb +7 -10
- data/templates/app_files/app/controllers/user/application_controller.rb +18 -0
- data/templates/app_files/app/controllers/user/dashboard_controller.rb +7 -0
- data/templates/{app → app_files/app}/controllers/user/passwords_controller.rb +3 -4
- data/templates/app_files/app/controllers/user/profile_controller.rb +30 -0
- data/templates/{app → app_files/app}/controllers/user/registrations_controller.rb +7 -8
- data/templates/{app → app_files/app}/controllers/user/sessions_controller.rb +5 -6
- data/templates/app_files/app/controllers/welcome_controller.rb +9 -0
- data/templates/app_files/app/helpers/application_helper.rb.erb +61 -0
- data/templates/app_files/app/mailers/admin_mailer.rb +10 -0
- data/templates/app_files/app/mailers/application_mailer.rb +6 -0
- data/templates/app_files/app/mailers/user_mailer.rb +10 -0
- data/templates/app_files/app/models/admin.rb +42 -0
- data/templates/app_files/app/models/audit.rb +4 -0
- data/templates/app_files/app/models/concerns/password_creatable.rb +39 -0
- data/templates/app_files/app/models/user.rb +43 -0
- data/templates/app_files/app/vendor/assets/javascripts/footable.min.js +10 -0
- data/templates/{vendor → app_files/app/vendor}/assets/javascripts/jquery.datetimepicker.js +0 -0
- data/templates/{vendor → app_files/app/vendor}/assets/javascripts/jquery.maskedinput.min.js +0 -0
- data/templates/{vendor → app_files/app/vendor}/assets/javascripts/nprogress.js +0 -0
- data/templates/{vendor → app_files/app/vendor}/assets/javascripts/trix.js +0 -0
- data/templates/app_files/app/vendor/assets/stylesheets/footable.bootstrap.min.css +1 -0
- data/templates/{vendor → app_files/app/vendor}/assets/stylesheets/jquery.datetimepicker.css +0 -0
- data/templates/{vendor → app_files/app/vendor}/assets/stylesheets/nprogress.css +0 -1
- data/templates/{vendor → app_files/app/vendor}/assets/stylesheets/trix.css +0 -0
- data/templates/app_files/app/views/admin_mailer/login_info.html.haml +13 -0
- data/templates/app_files/app/views/hq/admins/_admin.html.haml +38 -0
- data/templates/{app → app_files/app}/views/hq/admins/_blank.html.haml +3 -3
- data/templates/app_files/app/views/hq/admins/_filters.html.haml +27 -0
- data/templates/app_files/app/views/hq/admins/_form.html.haml +17 -0
- data/templates/app_files/app/views/hq/admins/_list.html.haml +20 -0
- data/templates/app_files/app/views/hq/admins/edit.html.haml +3 -0
- data/templates/app_files/app/views/hq/admins/index.html.haml +18 -0
- data/templates/{app → app_files/app}/views/hq/admins/new.html.haml +2 -2
- data/templates/{app → app_files/app}/views/hq/admins/show.html.haml +8 -8
- data/templates/app_files/app/views/hq/audits/_filters.html.haml +48 -0
- data/templates/app_files/app/views/hq/audits/_list.html.haml +47 -0
- data/templates/{app → app_files/app}/views/hq/audits/index.html.haml +3 -3
- data/templates/app_files/app/views/hq/audits/show.html.haml +8 -0
- data/templates/app_files/app/views/hq/dashboard/index.html.haml +13 -0
- data/templates/app_files/app/views/hq/passwords/edit.html.haml +24 -0
- data/templates/app_files/app/views/hq/passwords/new.html.haml +21 -0
- data/templates/app_files/app/views/hq/registrations/edit.html.haml +30 -0
- data/templates/app_files/app/views/hq/sessions/new.html.haml +20 -0
- data/templates/{app → app_files/app}/views/hq/users/_blank.html.haml +3 -3
- data/templates/app_files/app/views/hq/users/_filters.html.haml +26 -0
- data/templates/app_files/app/views/hq/users/_form.html.haml +17 -0
- data/templates/app_files/app/views/hq/users/_list.html.haml +21 -0
- data/templates/app_files/app/views/hq/users/_user.html.haml +38 -0
- data/templates/app_files/app/views/hq/users/edit.html.haml +3 -0
- data/templates/app_files/app/views/hq/users/index.html.haml +18 -0
- data/templates/{app → app_files/app}/views/hq/users/new.html.haml +2 -2
- data/templates/{app → app_files/app}/views/hq/users/show.html.haml +8 -9
- data/templates/app_files/app/views/layouts/application.html.haml.erb +33 -0
- data/templates/app_files/app/views/layouts/hq/application.html.haml.erb +57 -0
- data/templates/app_files/app/views/layouts/hq/login.html.haml.erb +47 -0
- data/templates/app_files/app/views/layouts/hq/partials/_breadcrumb.html.haml +3 -0
- data/templates/app_files/app/views/layouts/hq/partials/_dock.html.haml +95 -0
- data/templates/{app/views/layouts/hq/partials/_footer.html.haml.erb → app_files/app/views/layouts/hq/partials/_footer.html.haml} +0 -0
- data/templates/app_files/app/views/layouts/hq/partials/_navbar.html.haml +35 -0
- data/templates/app_files/app/views/layouts/hq/partials/_toolbar.html.haml +3 -0
- data/templates/{app/views/layouts/hq/partials/_trackers.html.haml.erb → app_files/app/views/layouts/hq/partials/_trackers.html.haml} +0 -0
- data/templates/app_files/app/views/layouts/mailer.html.haml.erb +255 -0
- data/templates/app_files/app/views/layouts/partials/_messages.html.haml +11 -0
- data/templates/app_files/app/views/layouts/partials/_navbar.html.haml.erb +37 -0
- data/templates/{app/views/layouts/partials/_footer.html.haml.erb → app_files/app/views/layouts/partials/_warnings.html.haml} +0 -0
- data/templates/app_files/app/views/user/dashboard/index.html.haml +11 -0
- data/templates/app_files/app/views/user/passwords/edit.html.haml +18 -0
- data/templates/app_files/app/views/user/passwords/new.html.haml +18 -0
- data/templates/{app → app_files/app}/views/user/profile/_form.html.haml +5 -5
- data/templates/app_files/app/views/user/profile/edit.html.haml +3 -0
- data/templates/app_files/app/views/user/profile/show.html.haml +18 -0
- data/templates/app_files/app/views/user/registrations/edit.html.haml +30 -0
- data/templates/app_files/app/views/user/registrations/new.html.haml +33 -0
- data/templates/app_files/app/views/user/sessions/new.html.haml +15 -0
- data/templates/app_files/app/views/user_mailer/login_info.html.haml +13 -0
- data/templates/app_files/app/views/welcome/about.html.haml +3 -0
- data/templates/app_files/app/views/welcome/contact.html.haml +3 -0
- data/templates/app_files/app/views/welcome/index.html.haml.erb +19 -0
- data/templates/app_files/bootstrap_Gemfile.erb +4 -0
- data/templates/app_files/breadcrumb_Gemfile.erb +4 -0
- data/templates/app_files/jquery_Gemfile.erb +4 -0
- data/templates/{public → app_files/public}/images/favicon.png +0 -0
- data/templates/{public → app_files/public}/images/mail-logo.png +0 -0
- data/templates/basic_authentication/basic_authentication.rb +22 -0
- data/templates/basic_authentication/basic_authentication_settings.yml.erb +3 -0
- data/templates/basic_authentication/include_module.erb +2 -0
- data/templates/basic_authentication/no_basic_authentication.erb +2 -0
- data/templates/basic_authentication/yes_basic_authentication.erb +2 -0
- data/templates/bullet/bullet_settings.rb.erb +9 -0
- data/templates/config/config_application.rb.erb +4 -0
- data/templates/config/locales/devise.en.yml +99 -0
- data/templates/config/locales/devise.tr.yml +97 -0
- data/templates/config/locales/en.yml +34 -0
- data/templates/config/locales/mailer.en.yml +32 -0
- data/templates/config/locales/{email.tr.yml → mailer.tr.yml} +6 -2
- data/templates/config/locales/models.en.yml +74 -0
- data/templates/config/locales/models.tr.yml +11 -27
- data/templates/config/locales/responders.en.yml +15 -0
- data/templates/config/locales/responders.tr.yml +3 -2
- data/templates/config/locales/show_for.tr.yml +3 -3
- data/templates/config/locales/view.en.yml +73 -0
- data/templates/config/locales/view.tr.yml +55 -82
- data/templates/config/routes.rb.erb +63 -0
- data/templates/cybele_gitignore +4 -3
- data/templates/devise/devise_authenticate_admin.rb.erb +2 -0
- data/templates/devise/devise_before_action_strong_parameter.rb.erb +3 -0
- data/templates/devise/devise_mailer.rb.erb +1 -0
- data/templates/devise/devise_strong_parameter.rb.erb +13 -0
- data/templates/{app/views/devise → devise/devise_views}/confirmations/new.html.haml +4 -1
- data/templates/devise/devise_views/mailer/confirmation_instructions.html.haml +5 -0
- data/templates/devise/devise_views/mailer/reset_password_instructions.html.haml +7 -0
- data/templates/{app/views/devise → devise/devise_views}/mailer/unlock_instructions.html.haml +1 -1
- data/templates/devise/devise_views/passwords/edit.html.haml +19 -0
- data/templates/devise/devise_views/passwords/new.html.haml +14 -0
- data/templates/devise/devise_views/registrations/edit.html.haml +21 -0
- data/templates/devise/devise_views/registrations/new.html.haml +32 -0
- data/templates/{app/views/devise → devise/devise_views}/sessions/new.html.haml +8 -3
- data/templates/devise/devise_views/shared/_links.haml +29 -0
- data/templates/{app/views/devise → devise/devise_views}/unlocks/new.html.haml +4 -1
- data/templates/devise/seeds.rb.erb +1 -0
- data/templates/docker/Dockerfile.erb +48 -0
- data/templates/docker/docker-compose.yml.erb +46 -0
- data/templates/docker/docker_env_local_sample.erb +6 -0
- data/templates/docker/docker_env_local_sample_host.erb +1 -0
- data/templates/docker/docker_env_local_sample_sidekiq.erb +2 -0
- data/templates/docker/docker_env_staging_production_sidekiq.erb +2 -0
- data/templates/docker/start-app.sh.erb +7 -0
- data/templates/docker/start-sidekiq.sh.erb +27 -0
- data/templates/dotenv/.env.local.erb +5 -0
- data/templates/dotenv/.env.production.erb +5 -0
- data/templates/dotenv/.env.sample.erb +5 -0
- data/templates/dotenv/.env.staging.erb +5 -0
- data/templates/dotenv/dotenv_Gemfile.erb +2 -0
- data/templates/error_pages/error_control.erb +7 -0
- data/templates/error_pages/error_method.erb +10 -0
- data/templates/error_pages/error_route.erb.rb +2 -0
- data/templates/error_pages/internal_server_error.html.haml +2 -0
- data/templates/error_pages/not_found.html.haml +2 -0
- data/templates/guardfile/guardfile_settings.rb.erb +49 -0
- data/templates/haml/haml_Gemfile.erb +5 -0
- data/templates/mailer/.env.local.erb +7 -0
- data/templates/mailer/host.rb.erb +2 -0
- data/templates/mailer/mailer_settings.yml.erb +8 -0
- data/templates/mailer/smtp.rb.erb +10 -0
- data/templates/paperclip/paperclip.rb.erb +11 -0
- data/templates/paperclip/paperclip_Gemfile.erb +4 -0
- data/templates/paperclip/paperclip_env_local.erb +6 -0
- data/templates/paperclip/paperclip_env_production.erb +6 -0
- data/templates/paperclip/paperclip_env_sample.erb +6 -0
- data/templates/paperclip/paperclip_env_staging.erb +6 -0
- data/templates/paperclip/paperclip_settings.yml.erb +10 -0
- data/templates/postgresql_database.yml.erb +24 -0
- data/templates/pronto/.flayignore.erb +5 -0
- data/templates/pronto/.haml-lint.yml.erb +5 -0
- data/templates/pronto/.rubocop.yml.erb +38 -0
- data/templates/pronto/config.reek.erb +42 -0
- data/templates/pronto/example.pronto.yml.erb +27 -0
- data/templates/pronto/rubo.erb +24 -0
- data/templates/recipient_interceptor/recipient_interceptor_settings.yml.erb +4 -0
- data/templates/recipient_interceptor/recipient_interceptor_staging.rb.erb +2 -0
- data/templates/responders/responders_Gemfile.erb +3 -0
- data/templates/ruby-version +1 -1
- data/templates/secrets.yml.erb +3 -0
- data/templates/settings.yml.erb +1 -0
- data/templates/show_for/show_for_Gemfile.erb +3 -0
- data/templates/sidekiq/sidekiq.rake.erb +42 -0
- data/templates/sidekiq/sidekiq.rb.erb +18 -0
- data/templates/sidekiq/sidekiq.yml.erb +18 -0
- data/templates/sidekiq/sidekiq_Gemfile.erb +8 -0
- data/templates/{Procfile.erb → sidekiq/sidekiq_Procfile.erb} +0 -0
- data/templates/sidekiq/sidekiq_application.rb.erb +3 -0
- data/templates/sidekiq/sidekiq_routes_mount.erb +8 -0
- data/templates/sidekiq/sidekiq_routes_require.erb +3 -0
- data/templates/{config/schedule.yml → sidekiq/sidekiq_schedule.yml.erb} +6 -4
- data/templates/simple_form/simple_form_Gemfile.erb +3 -0
- data/templates/ssl/ssl_env_all.erb +2 -0
- metadata +369 -179
- data/templates/.env.local.erb +0 -11
- data/templates/.env.production.erb +0 -11
- data/templates/.env.staging.erb +0 -11
- data/templates/app/assets/javascripts/application.js.coffee +0 -81
- data/templates/app/assets/javascripts/hq/application.js.coffee +0 -94
- data/templates/app/assets/stylesheets/hq/application.css.sass +0 -92
- data/templates/app/controllers/application_controller.rb.erb +0 -48
- data/templates/app/controllers/concerns/basic_authentication.rb +0 -18
- data/templates/app/controllers/hq/application_controller.rb +0 -18
- data/templates/app/controllers/hq/cities_controller.rb +0 -54
- data/templates/app/controllers/hq/countries_controller.rb +0 -54
- data/templates/app/controllers/hq/dashboard_controller.rb +0 -8
- data/templates/app/controllers/hq/registrations_controller.rb +0 -21
- data/templates/app/controllers/user/dashboard_controller.rb +0 -8
- data/templates/app/controllers/user/profile_controller.rb +0 -34
- data/templates/app/controllers/user/user_application_controller.rb +0 -26
- data/templates/app/controllers/welcome_controller.rb +0 -4
- data/templates/app/helpers/application_helper.rb.erb +0 -27
- data/templates/app/mailers/admin_mailer.rb +0 -10
- data/templates/app/mailers/base_mailer.rb +0 -4
- data/templates/app/mailers/user_mailer.rb +0 -10
- data/templates/app/models/admin.rb +0 -51
- data/templates/app/models/audit.rb +0 -3
- data/templates/app/models/city.rb +0 -12
- data/templates/app/models/country.rb +0 -12
- data/templates/app/models/user.rb +0 -54
- data/templates/app/views/admin_mailer/login_info.html.haml +0 -13
- data/templates/app/views/devise/mailer/confirmation_instructions.html.haml +0 -6
- data/templates/app/views/devise/mailer/reset_password_instructions.html.haml +0 -9
- data/templates/app/views/devise/passwords/edit.html.haml +0 -11
- data/templates/app/views/devise/passwords/new.html.haml +0 -9
- data/templates/app/views/devise/registrations/edit.html.haml +0 -12
- data/templates/app/views/devise/registrations/new.html.haml +0 -24
- data/templates/app/views/devise/shared/_links.haml +0 -22
- data/templates/app/views/errors/internal_server_error.html.haml +0 -2
- data/templates/app/views/errors/not_found.html.haml +0 -2
- data/templates/app/views/hq/admins/_admin.html.haml +0 -21
- data/templates/app/views/hq/admins/_filters.html.haml +0 -20
- data/templates/app/views/hq/admins/_form.html.haml +0 -17
- data/templates/app/views/hq/admins/_list.html.haml +0 -15
- data/templates/app/views/hq/admins/edit.html.haml +0 -3
- data/templates/app/views/hq/admins/index.html.haml +0 -18
- data/templates/app/views/hq/audits/_filters.html.haml +0 -32
- data/templates/app/views/hq/audits/_list.html.haml +0 -37
- data/templates/app/views/hq/audits/show.html.haml +0 -5
- data/templates/app/views/hq/cities/_blank.html.haml +0 -9
- data/templates/app/views/hq/cities/_city.html.haml +0 -12
- data/templates/app/views/hq/cities/_filters.html.haml +0 -15
- data/templates/app/views/hq/cities/_form.html.haml +0 -15
- data/templates/app/views/hq/cities/_list.html.haml +0 -13
- data/templates/app/views/hq/cities/edit.html.haml +0 -3
- data/templates/app/views/hq/cities/index.html.haml +0 -18
- data/templates/app/views/hq/cities/new.html.haml +0 -3
- data/templates/app/views/hq/cities/show.html.haml +0 -13
- data/templates/app/views/hq/countries/_blank.html.haml +0 -9
- data/templates/app/views/hq/countries/_country.html.haml +0 -11
- data/templates/app/views/hq/countries/_filters.html.haml +0 -14
- data/templates/app/views/hq/countries/_form.html.haml +0 -14
- data/templates/app/views/hq/countries/_list.html.haml +0 -12
- data/templates/app/views/hq/countries/edit.html.haml +0 -3
- data/templates/app/views/hq/countries/index.html.haml +0 -18
- data/templates/app/views/hq/countries/new.html.haml +0 -3
- data/templates/app/views/hq/countries/show.html.haml +0 -14
- data/templates/app/views/hq/dashboard/index.html.haml +0 -8
- data/templates/app/views/hq/passwords/edit.html.haml +0 -12
- data/templates/app/views/hq/passwords/new.html.haml +0 -9
- data/templates/app/views/hq/registrations/edit.html.haml +0 -19
- data/templates/app/views/hq/sessions/new.html.haml +0 -11
- data/templates/app/views/hq/users/_filters.html.haml +0 -20
- data/templates/app/views/hq/users/_form.html.haml +0 -18
- data/templates/app/views/hq/users/_list.html.haml +0 -15
- data/templates/app/views/hq/users/_user.html.haml +0 -20
- data/templates/app/views/hq/users/edit.html.haml +0 -3
- data/templates/app/views/hq/users/index.html.haml +0 -18
- data/templates/app/views/layouts/application.html.haml.erb +0 -56
- data/templates/app/views/layouts/hq/application.html.haml.erb +0 -55
- data/templates/app/views/layouts/hq/login.html.haml.erb +0 -35
- data/templates/app/views/layouts/hq/partials/_dock.html.haml.erb +0 -36
- data/templates/app/views/layouts/hq/partials/_navbar.html.haml.erb +0 -22
- data/templates/app/views/layouts/mailer.html.haml.erb +0 -321
- data/templates/app/views/layouts/mailer.text.haml +0 -1
- data/templates/app/views/layouts/partials/_trackers.html.haml.erb +0 -0
- data/templates/app/views/layouts/partials/_warnings.html.haml.erb +0 -3
- data/templates/app/views/user/dashboard/index.html.haml +0 -8
- data/templates/app/views/user/passwords/edit.html.haml +0 -12
- data/templates/app/views/user/passwords/new.html.haml +0 -10
- data/templates/app/views/user/profile/edit.html.haml +0 -3
- data/templates/app/views/user/profile/show.html.haml +0 -18
- data/templates/app/views/user/registrations/edit.html.haml +0 -19
- data/templates/app/views/user/sessions/new.html.haml +0 -11
- data/templates/app/views/user_mailer/login_info.html.haml +0 -13
- data/templates/app/views/welcome/index.html.haml.erb +0 -16
- data/templates/config/database.yml.erb +0 -21
- data/templates/config/deploy.rb +0 -56
- data/templates/config/initializers/devise_async.rb +0 -6
- data/templates/config/initializers/disable_xml_params.rb +0 -3
- data/templates/config/initializers/mail.rb +0 -13
- data/templates/config/initializers/paperclip.rb +0 -10
- data/templates/config/initializers/secret_token.erb +0 -25
- data/templates/config/initializers/show_for.rb +0 -3
- data/templates/config/initializers/sidekiq.rb +0 -13
- data/templates/config/initializers/simple_form.rb +0 -142
- data/templates/config/initializers/simple_form_bootstrap.rb +0 -207
- data/templates/config/routes.erb +0 -51
- data/templates/config/settings.yml +0 -0
- data/templates/config/settings/production.yml +0 -0
- data/templates/config/settings/staging.yml +0 -0
- data/templates/config/sidekiq.yml +0 -13
- data/templates/cybele_Gemfile +0 -106
- data/templates/cybele_version.txt +0 -1
- data/templates/env.sample.erb +0 -11
- data/templates/lib/application_responder.rb +0 -8
- data/templates/lib/data/cities.yml +0 -163
- data/templates/lib/tasks/annotate.rake +0 -6
- data/templates/lib/tasks/dev.rake +0 -56
- data/templates/lib/tasks/sidekiq.rake +0 -26
- data/templates/lib/templates/rails/responders_controller/controller.rb +0 -56
- data/templates/public/images/missing_cover.png +0 -0
- data/templates/public/images/missing_cover@2x.png +0 -0
- data/templates/public/images/missing_logo.png +0 -0
- data/templates/public/images/missing_logo@2x.png +0 -0
- data/templates/public/images/sprite.png +0 -0
|
@@ -1,283 +1,343 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'rails/generators'
|
|
2
4
|
require 'rails/generators/rails/app/app_generator'
|
|
3
5
|
|
|
4
6
|
module Cybele
|
|
5
|
-
|
|
6
7
|
class AppGenerator < Rails::Generators::AppGenerator
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
@options = nil
|
|
9
|
+
|
|
10
|
+
# Default settings
|
|
11
|
+
class_option :database,
|
|
12
|
+
type: :string,
|
|
13
|
+
aliases: '-d',
|
|
14
|
+
default: 'postgresql',
|
|
15
|
+
desc: "Configure for selected database (options: #{DATABASES.join('/')})"
|
|
16
|
+
class_option :version,
|
|
17
|
+
type: :boolean,
|
|
18
|
+
aliases: '-v',
|
|
19
|
+
group: :cybele,
|
|
20
|
+
desc: 'Show cybele version number and quit'
|
|
21
|
+
class_option :help,
|
|
22
|
+
type: :boolean,
|
|
23
|
+
aliases: '-h',
|
|
24
|
+
group: :cybele,
|
|
25
|
+
desc: 'Show cybele help message and quit'
|
|
26
|
+
# Ask cybele options
|
|
27
|
+
class_option :skip_ask,
|
|
28
|
+
type: :boolean,
|
|
29
|
+
aliases: nil,
|
|
30
|
+
default: true,
|
|
31
|
+
group: :cybele,
|
|
32
|
+
desc: 'Skip ask for cybele options. Default: skip'
|
|
33
|
+
class_option :skip_create_database,
|
|
34
|
+
type: :boolean,
|
|
35
|
+
aliases: nil,
|
|
36
|
+
default: false,
|
|
37
|
+
group: :cybele,
|
|
38
|
+
desc: 'Skip create database. Default: don\'t skip'
|
|
39
|
+
class_option :skip_sidekiq,
|
|
40
|
+
type: :boolean,
|
|
41
|
+
aliases: nil,
|
|
42
|
+
default: false,
|
|
43
|
+
group: :cybele,
|
|
44
|
+
desc: 'Skip sidekiq integration. Default: don\'t skip'
|
|
45
|
+
class_option :skip_simple_form,
|
|
46
|
+
type: :boolean,
|
|
47
|
+
aliases: nil,
|
|
48
|
+
default: false,
|
|
49
|
+
group: :cybele,
|
|
50
|
+
desc: 'Skip simple_form integration. Default: don\'t skip'
|
|
51
|
+
class_option :skip_show_for,
|
|
52
|
+
type: :boolean,
|
|
53
|
+
aliases: nil,
|
|
54
|
+
default: false,
|
|
55
|
+
group: :cybele,
|
|
56
|
+
desc: 'Skip show_for integration. Default: don\'t skip'
|
|
57
|
+
class_option :skip_haml,
|
|
58
|
+
type: :boolean,
|
|
59
|
+
aliases: nil,
|
|
60
|
+
default: false,
|
|
61
|
+
group: :cybele,
|
|
62
|
+
desc: 'Skip haml and haml-rails integration. Default: don\'t skip'
|
|
63
|
+
class_option :skip_view_files,
|
|
64
|
+
type: :boolean,
|
|
65
|
+
aliases: nil,
|
|
66
|
+
default: false,
|
|
67
|
+
group: :cybele,
|
|
68
|
+
desc: 'Skip view files. Default: don\'t skip. Dependent: haml, show-for, simple-form'
|
|
69
|
+
class_option :skip_docker,
|
|
70
|
+
type: :boolean,
|
|
71
|
+
aliases: nil,
|
|
72
|
+
default: false,
|
|
73
|
+
group: :cybele,
|
|
74
|
+
desc: 'Skip docker development environment. Default: don\'t skip'
|
|
75
|
+
|
|
76
|
+
def initialize(*args)
|
|
16
77
|
super
|
|
17
|
-
|
|
78
|
+
# Set options
|
|
79
|
+
@options = options.dup
|
|
18
80
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
invoke :setup_editorconfig
|
|
22
|
-
invoke :setup_ruby_version
|
|
23
|
-
invoke :setup_add_disable_xml_params
|
|
24
|
-
invoke :setup_add_paperclip_aws
|
|
25
|
-
invoke :setup_database
|
|
26
|
-
invoke :remove_files_we_dont_need
|
|
27
|
-
invoke :replace_files
|
|
28
|
-
invoke :install_gems
|
|
29
|
-
invoke :gitignore_files_and_folders
|
|
30
|
-
invoke :setup_bootstrap_sass_coffee
|
|
31
|
-
invoke :copy_vendor_files
|
|
32
|
-
invoke :setup_rails_config
|
|
33
|
-
invoke :setup_staging_environment
|
|
34
|
-
invoke :configure_mail_setting
|
|
35
|
-
invoke :setup_rspec
|
|
36
|
-
invoke :setup_capybara
|
|
37
|
-
invoke :setup_factory_girl
|
|
38
|
-
invoke :setup_simple_form
|
|
39
|
-
invoke :setup_exception_notification
|
|
40
|
-
invoke :setup_exception_notification_to_environments
|
|
41
|
-
invoke :setup_welcome_page
|
|
42
|
-
invoke :setup_devise
|
|
43
|
-
invoke :setup_time_zone
|
|
44
|
-
invoke :setup_bullet_config
|
|
45
|
-
invoke :setup_namespaces
|
|
81
|
+
dependency_control(@options) if @options[:skip_ask]
|
|
82
|
+
ask_questions(@options) unless @options[:skip_ask]
|
|
46
83
|
end
|
|
47
84
|
|
|
85
|
+
# :reek:TooManyStatements
|
|
48
86
|
def customize_gemfile
|
|
49
|
-
|
|
87
|
+
say 'Customize gem file', :green
|
|
88
|
+
build :add_gems
|
|
89
|
+
bundle_command 'update thor'
|
|
90
|
+
build :add_simple_form_gem unless @options[:skip_simple_form]
|
|
91
|
+
build :add_show_for_gem unless @options[:skip_show_for]
|
|
92
|
+
build :add_haml_gems unless @options[:skip_haml]
|
|
93
|
+
build :add_required_view_gems unless @options[:skip_view_files]
|
|
50
94
|
bundle_command 'install --binstubs=bin/stubs'
|
|
51
95
|
end
|
|
52
96
|
|
|
53
|
-
def
|
|
54
|
-
say 'Add .
|
|
55
|
-
build :
|
|
97
|
+
def setup_editor_config
|
|
98
|
+
say 'Add .editor_config file', :green
|
|
99
|
+
build :add_editor_config
|
|
56
100
|
end
|
|
57
101
|
|
|
58
102
|
def setup_ruby_version
|
|
59
|
-
say 'Add .ruby-version file'
|
|
103
|
+
say 'Add .ruby-version file', :green
|
|
60
104
|
build :add_ruby_version
|
|
61
105
|
end
|
|
62
106
|
|
|
63
|
-
def
|
|
64
|
-
say 'Add
|
|
65
|
-
build :
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def setup_add_paperclip_aws
|
|
69
|
-
say 'Add paperclip.rb file to initilizers'
|
|
70
|
-
build :add_paperclip_aws
|
|
107
|
+
def setup_cybele_version
|
|
108
|
+
say 'Add .VERSION.txt file', :green
|
|
109
|
+
build :add_cybele_version
|
|
71
110
|
end
|
|
72
111
|
|
|
73
112
|
def remove_files_we_dont_need
|
|
74
|
-
say 'Remove files we don\'t need'
|
|
113
|
+
say 'Remove files we don\'t need', :green
|
|
75
114
|
build :remove_readme_rdoc
|
|
76
115
|
end
|
|
77
116
|
|
|
78
|
-
def
|
|
79
|
-
say '
|
|
80
|
-
build :
|
|
81
|
-
build :replace_database_yml
|
|
117
|
+
def setup_config
|
|
118
|
+
say 'Generate config', :green
|
|
119
|
+
build :generate_config
|
|
82
120
|
end
|
|
83
121
|
|
|
84
|
-
def
|
|
85
|
-
say '
|
|
86
|
-
|
|
87
|
-
build :install_responder_gem
|
|
122
|
+
def setup_dotenv
|
|
123
|
+
say 'Generate .env.* files', :green
|
|
124
|
+
build :configure_dotenv
|
|
88
125
|
end
|
|
89
126
|
|
|
90
127
|
def setup_database
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
build :replace_database_yml
|
|
128
|
+
if @options[:database] == 'postgresql'
|
|
129
|
+
say 'Set up postgresql template', :green
|
|
130
|
+
build :use_postgres_config_template
|
|
95
131
|
end
|
|
96
132
|
|
|
133
|
+
return if @options[:skip_create_database]
|
|
134
|
+
say 'Create database', :green
|
|
97
135
|
build :create_database
|
|
98
136
|
end
|
|
99
137
|
|
|
100
|
-
def
|
|
101
|
-
|
|
102
|
-
|
|
138
|
+
def setup_sidekiq
|
|
139
|
+
return if @options[:skip_sidekiq]
|
|
140
|
+
say 'Setting up sidekiq', :green
|
|
141
|
+
build :configure_sidekiq
|
|
103
142
|
end
|
|
104
143
|
|
|
105
|
-
def
|
|
106
|
-
|
|
107
|
-
build :
|
|
144
|
+
def setup_responders
|
|
145
|
+
say 'Setting up responders', :green
|
|
146
|
+
build :configure_responders
|
|
108
147
|
end
|
|
109
148
|
|
|
110
|
-
def
|
|
111
|
-
say '
|
|
112
|
-
build :
|
|
113
|
-
build :setup_application_js
|
|
114
|
-
build :convert_application_js_to_coffee
|
|
115
|
-
build :convert_application_css_to_sass
|
|
149
|
+
def setup_staging_environment
|
|
150
|
+
say 'Setting up the staging environment', :green
|
|
151
|
+
build :setup_staging_environment
|
|
116
152
|
end
|
|
117
153
|
|
|
118
|
-
def
|
|
119
|
-
say '
|
|
120
|
-
build :
|
|
154
|
+
def configure_recipient_interceptor
|
|
155
|
+
say 'Setup mail settings with recipient_interceptor in staging', :green
|
|
156
|
+
build :configure_recipient_interceptor
|
|
121
157
|
end
|
|
122
158
|
|
|
123
|
-
def
|
|
124
|
-
say '
|
|
125
|
-
build :
|
|
126
|
-
build :configure_smtp
|
|
127
|
-
build :setup_letter_opener
|
|
159
|
+
def setup_rollbar
|
|
160
|
+
say 'Generate rollbar', :green
|
|
161
|
+
build :generate_rollbar
|
|
128
162
|
end
|
|
129
163
|
|
|
130
|
-
def
|
|
131
|
-
say 'Generate
|
|
132
|
-
build :
|
|
164
|
+
def setup_guard
|
|
165
|
+
say 'Generate guard', :green
|
|
166
|
+
build :generate_guard
|
|
133
167
|
end
|
|
134
168
|
|
|
135
|
-
def
|
|
136
|
-
say '
|
|
137
|
-
build :
|
|
169
|
+
def configure_locale_language
|
|
170
|
+
say 'Configure locale', :green
|
|
171
|
+
build :configure_locale_language
|
|
138
172
|
end
|
|
139
173
|
|
|
140
|
-
def
|
|
141
|
-
|
|
142
|
-
|
|
174
|
+
def setup_show_for
|
|
175
|
+
return if @options[:skip_show_for]
|
|
176
|
+
say 'Generate show_for', :green
|
|
177
|
+
build :configure_show_for
|
|
143
178
|
end
|
|
144
179
|
|
|
145
180
|
def setup_simple_form
|
|
146
|
-
|
|
147
|
-
|
|
181
|
+
return if @options[:skip_simple_form]
|
|
182
|
+
say 'Setting up simple_form', :green
|
|
183
|
+
build :configure_simple_form
|
|
148
184
|
end
|
|
149
185
|
|
|
150
|
-
def
|
|
151
|
-
|
|
152
|
-
say '
|
|
153
|
-
build :
|
|
186
|
+
def setup_haml
|
|
187
|
+
return if @options[:skip_haml]
|
|
188
|
+
say 'Setting up haml and generate haml-rails', :green
|
|
189
|
+
build :configure_haml
|
|
154
190
|
end
|
|
155
191
|
|
|
156
|
-
def
|
|
157
|
-
say '
|
|
158
|
-
build :
|
|
192
|
+
def add_staging_secret_key
|
|
193
|
+
say 'Add staging secret key to secret.yml file', :green
|
|
194
|
+
build :add_staging_secret_key_to_secrets_yml
|
|
159
195
|
end
|
|
160
196
|
|
|
161
|
-
def
|
|
162
|
-
say '
|
|
163
|
-
build :
|
|
164
|
-
say 'Adding devise user model'
|
|
165
|
-
build :generate_devise_user
|
|
166
|
-
build :generate_devise_views
|
|
197
|
+
def setup_bullet_config
|
|
198
|
+
say 'Setup bullet config'
|
|
199
|
+
build :configure_bullet
|
|
167
200
|
end
|
|
168
201
|
|
|
169
|
-
def
|
|
170
|
-
say '
|
|
171
|
-
build :
|
|
202
|
+
def force_ssl
|
|
203
|
+
say 'Add ssl control into staging.rb and production.rb', :green
|
|
204
|
+
build :force_ssl_setting
|
|
172
205
|
end
|
|
173
206
|
|
|
174
|
-
def
|
|
175
|
-
say '
|
|
176
|
-
build :
|
|
207
|
+
def setup_paperclip_and_add_aws
|
|
208
|
+
say 'Setting up paperclip, editing settings.yml and env files', :green
|
|
209
|
+
build :configure_paperclip
|
|
177
210
|
end
|
|
178
211
|
|
|
179
|
-
def
|
|
180
|
-
say '
|
|
181
|
-
build :
|
|
212
|
+
def setup_devise
|
|
213
|
+
say 'Generate devise'
|
|
214
|
+
build :generate_devise_settings
|
|
215
|
+
say 'Adding devise models'
|
|
216
|
+
build :generate_devise_models
|
|
182
217
|
end
|
|
183
218
|
|
|
184
|
-
def
|
|
185
|
-
say 'Setup
|
|
186
|
-
build :
|
|
219
|
+
def configure_mail_setting
|
|
220
|
+
say 'Setup mail settings'
|
|
221
|
+
build :configure_action_mailer
|
|
222
|
+
build :configure_smtp
|
|
187
223
|
end
|
|
188
224
|
|
|
189
|
-
def
|
|
190
|
-
|
|
191
|
-
build :
|
|
225
|
+
def gitignore_files_and_folders
|
|
226
|
+
build :setup_gitignore_files
|
|
227
|
+
build :setup_gitignore_folders
|
|
192
228
|
end
|
|
193
229
|
|
|
194
|
-
def
|
|
195
|
-
say 'Setup
|
|
196
|
-
build :
|
|
230
|
+
def configure_error_pages
|
|
231
|
+
say 'Setup custom exception pages and 404 page', :green
|
|
232
|
+
build :configure_error_pages
|
|
197
233
|
end
|
|
198
234
|
|
|
199
|
-
def
|
|
200
|
-
say 'Setup
|
|
201
|
-
build :
|
|
235
|
+
def setup_pronto_config
|
|
236
|
+
say 'Setup pronto config', :green
|
|
237
|
+
build :configure_pronto
|
|
202
238
|
end
|
|
203
239
|
|
|
204
|
-
def
|
|
205
|
-
|
|
240
|
+
def setup_audited
|
|
241
|
+
say 'Setup audited gem', :green
|
|
242
|
+
build :configure_audited
|
|
206
243
|
end
|
|
207
244
|
|
|
208
|
-
def
|
|
209
|
-
say '
|
|
210
|
-
build :
|
|
245
|
+
def customize_app_files
|
|
246
|
+
say 'Customize default files', :green
|
|
247
|
+
build :customize_model_files
|
|
248
|
+
build :customize_mailer_files
|
|
249
|
+
build :customize_default_view_files
|
|
211
250
|
end
|
|
212
251
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
252
|
+
# :reek:TooManyStatements
|
|
253
|
+
def customize_optional_view_files
|
|
254
|
+
return if @options[:skip_view_files]
|
|
255
|
+
say 'Customize optional view files', :green
|
|
256
|
+
build :customize_assets_files
|
|
257
|
+
build :customize_vendor_files
|
|
258
|
+
build :customize_helper_files
|
|
259
|
+
build :customize_view_files_with_option
|
|
260
|
+
build :generate_devise_views
|
|
261
|
+
build :configure_routes
|
|
262
|
+
build :customize_controller_files
|
|
263
|
+
build :add_devise_strong_parameter
|
|
264
|
+
build :add_devise_authenticate_admin
|
|
265
|
+
build :configure_basic_authentication
|
|
216
266
|
end
|
|
217
267
|
|
|
218
|
-
def
|
|
219
|
-
|
|
220
|
-
|
|
268
|
+
def docker_development_env
|
|
269
|
+
return if @options[:skip_docker]
|
|
270
|
+
say 'Setup docker development environment', :green
|
|
271
|
+
build :setup_docker_development_env
|
|
221
272
|
end
|
|
222
273
|
|
|
223
|
-
def
|
|
224
|
-
say '
|
|
225
|
-
build :
|
|
274
|
+
def setup_git_and_git_flow
|
|
275
|
+
say 'Initialize git and git flow'
|
|
276
|
+
build :git_and_git_flow_commands
|
|
226
277
|
end
|
|
227
278
|
|
|
228
|
-
def
|
|
229
|
-
say '
|
|
230
|
-
build :create_dev_rake
|
|
279
|
+
def goodbye
|
|
280
|
+
say 'Congratulations! That\'s all...', :green
|
|
231
281
|
end
|
|
232
282
|
|
|
233
|
-
def
|
|
234
|
-
|
|
235
|
-
build :custom_exception_page
|
|
283
|
+
def self.banner
|
|
284
|
+
"cybele #{arguments.map(&:usage).join(' ')} [options]"
|
|
236
285
|
end
|
|
237
286
|
|
|
238
|
-
|
|
239
|
-
say 'Setup 404 page'
|
|
240
|
-
build :custom_404
|
|
241
|
-
end
|
|
287
|
+
protected
|
|
242
288
|
|
|
243
|
-
def
|
|
244
|
-
|
|
245
|
-
build :add_seeds
|
|
289
|
+
def get_builder_class
|
|
290
|
+
Cybele::AppBuilder
|
|
246
291
|
end
|
|
247
292
|
|
|
248
|
-
|
|
249
|
-
say 'Generate namespaces'
|
|
250
|
-
build :setup_namespaces
|
|
251
|
-
end
|
|
293
|
+
private
|
|
252
294
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
295
|
+
# :reek:TooManyStatements
|
|
296
|
+
def ask_questions(options)
|
|
297
|
+
say 'Ask cybele options', :green
|
|
298
|
+
option_with_ask_limited(options, :database, DATABASES)
|
|
299
|
+
option_with_ask_yes(options, :skip_create_database)
|
|
300
|
+
option_with_ask_yes(options, :skip_sidekiq)
|
|
301
|
+
option_with_ask_yes(options, :skip_simple_form)
|
|
302
|
+
option_with_ask_yes(options, :skip_show_for)
|
|
303
|
+
option_with_ask_yes(options, :skip_haml)
|
|
304
|
+
option_with_ask_yes(options, :skip_view_files)
|
|
305
|
+
option_with_ask_yes(options, :skip_docker)
|
|
306
|
+
options.freeze
|
|
307
|
+
dependency_control(options)
|
|
256
308
|
end
|
|
257
309
|
|
|
258
|
-
def
|
|
259
|
-
say
|
|
260
|
-
|
|
261
|
-
|
|
310
|
+
def option_with_ask_yes(options, key)
|
|
311
|
+
say "==> #{key.to_s.humanize}", :green
|
|
312
|
+
say 'Type for answer yes: y|yes', :green
|
|
313
|
+
say 'Type for answer no: n|no|any character', :yellow
|
|
262
314
|
|
|
263
|
-
|
|
264
|
-
say 'Create helpers'
|
|
265
|
-
build :create_jobs_helper_lib
|
|
315
|
+
options[key] = yes?('Ans :', :green)
|
|
266
316
|
end
|
|
267
317
|
|
|
268
|
-
def
|
|
269
|
-
|
|
270
|
-
build :git_commands
|
|
318
|
+
def option_with_ask_limited(options, key, limits)
|
|
319
|
+
options[key] = ask("#{key.to_s.humanize} :", limited_to: limits)
|
|
271
320
|
end
|
|
272
321
|
|
|
273
|
-
def
|
|
274
|
-
|
|
322
|
+
def dependency_control(selected_options)
|
|
323
|
+
arg_checker(selected_options, :skip_view_files, %i[skip_haml skip_show_for skip_simple_form])
|
|
275
324
|
end
|
|
276
325
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
326
|
+
# :reek:TooManyStatements
|
|
327
|
+
def arg_checker(selected_options, option, option_array)
|
|
328
|
+
return if selected_options[option]
|
|
329
|
+
failed = false
|
|
330
|
+
option_array.each do |opt|
|
|
331
|
+
if selected_options[opt]
|
|
332
|
+
puts "Don't #{opt}"
|
|
333
|
+
failed = true
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
return unless failed
|
|
337
|
+
puts "#{option} dependency error!"
|
|
338
|
+
puts
|
|
339
|
+
puts 'See --help for more info'
|
|
340
|
+
exit 0
|
|
281
341
|
end
|
|
282
342
|
end
|
|
283
|
-
end
|
|
343
|
+
end
|