lib/kazan/generators/app_generator.rb in kazan-0.2.4 vs lib/kazan/generators/app_generator.rb in kazan-0.3.0

- old
+ new

@@ -28,18 +28,16 @@ invoke :setup_development_environment invoke :setup_test_environment invoke :setup_production_environment invoke :setup_database - unless options[:api] - invoke :setup_assets - invoke :setup_helpers - end + invoke :setup_assets + invoke :setup_helpers + invoke :setup_error_pages - invoke :setup_static if options[:static] + invoke :setup_static - invoke :setup_error_pages invoke :setup_bundler_audit invoke :setup_spring invoke :setup_empty_directories invoke :setup_project_repository invoke :outro @@ -49,12 +47,14 @@ say 'Setup ruby' build :ruby_version end def setup_gems - say 'Setup gems' - build :gemfile_api if options[:api] + if options[:api] + say 'Setup gems' + build :gemfile_api + end end def setup_secrets say 'Setup secrets' build :dotenvs @@ -107,35 +107,43 @@ build :postgres_config if options[:database] == 'postgresql' build :database_tables end def setup_assets - say 'Setup assets' - build :shared_views_directory - build :shared_flash - build :shared_javascript - build :shared_styles - build :assets_config + unless options[:api] + say 'Setup assets' + build :shared_views_directory + build :shared_flash + build :shared_javascript + build :shared_styles + build :assets_config + end end def setup_helpers - build :simple_form_config - build :rack_mini_profiler_config + unless options[:api] + build :simple_form_config + build :rack_mini_profiler_config + end end def setup_static - say 'Setup static' + if options[:static] && !options[:api] + say 'Setup static' - build :remove_turbolinks - build :stylesheets_gems - build :stylesheets_manifest - build :refils - build :bitters + build :remove_turbolinks + build :stylesheets_gems + build :stylesheets_manifest + build :refils + build :bitters + end end def setup_error_pages - say 'Customizing the 500/404/422 pages' - build :static_pages + unless options[:api] + say 'Customizing the 500/404/422 pages' + build :static_pages + end end def setup_bundler_audit say 'Setup bundler audit' build :bundler_audit_config