diff --git a/README.md b/README.md index 17d829c36..e6915b25e 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,8 @@ And development gems like: pre-loading * [Web Console](https://github.com/rails/web-console) for better debugging via in-browser IRB consoles. +* [Quiet Assets](https://github.com/evrone/quiet_assets) for muting assets + pipeline log messages And testing gems like: diff --git a/lib/suspenders/app_builder.rb b/lib/suspenders/app_builder.rb index 1e1cc0c7e..63799c519 100644 --- a/lib/suspenders/app_builder.rb +++ b/lib/suspenders/app_builder.rb @@ -27,6 +27,14 @@ def raise_on_unpermitted_parameters inject_into_class "config/application.rb", "Application", config end + def configure_quiet_assets + config = <<-RUBY + config.quiet_assets = true + RUBY + + inject_into_class "config/application.rb", "Application", config + end + def provide_setup_script template "bin_setup.erb", "bin/setup", force: true run "chmod a+x bin/setup" diff --git a/lib/suspenders/generators/app_generator.rb b/lib/suspenders/generators/app_generator.rb index 0cd05d692..5bf93f6b1 100644 --- a/lib/suspenders/generators/app_generator.rb +++ b/lib/suspenders/generators/app_generator.rb @@ -86,6 +86,7 @@ def setup_development_environment build :provide_dev_prime_task build :configure_generators build :configure_i18n_for_missing_translations + build :configure_quiet_assets end def setup_test_environment diff --git a/spec/features/new_project_spec.rb b/spec/features/new_project_spec.rb index be9a84153..664e1968a 100644 --- a/spec/features/new_project_spec.rb +++ b/spec/features/new_project_spec.rb @@ -76,6 +76,14 @@ ) end + it "adds explicit quiet_assets configuration" do + result = IO.read("#{project_path}/config/application.rb") + + expect(result).to match( + /^ +config.quiet_assets = true$/ + ) + end + it "raises on missing translations in development and test" do %w[development test].each do |environment| environment_file = diff --git a/templates/Gemfile.erb b/templates/Gemfile.erb index 5ef52c5a6..9fa1262cc 100644 --- a/templates/Gemfile.erb +++ b/templates/Gemfile.erb @@ -25,6 +25,7 @@ gem "title" gem "uglifier" group :development do + gem "quiet_assets" gem "refills" gem "spring" gem "spring-commands-rspec"