Skip assets options in environments files when --skip-sprockets is used

This commit is contained in:
Guillermo Iguaran
2011-12-11 08:48:58 -05:00
parent 79835090e2
commit ea5a70a462
3 changed files with 13 additions and 0 deletions

View File

@@ -31,9 +31,11 @@
config.active_record.auto_explain_threshold_in_seconds = 0.5
<%- end -%>
<%- unless options.skip_sprockets? -%>
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
<%- end -%>
end

View File

@@ -11,6 +11,7 @@
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
<%- unless options.skip_sprockets? -%>
# Compress JavaScripts and CSS
config.assets.compress = true
@@ -22,6 +23,7 @@
# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH
<%- end -%>
# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
@@ -45,8 +47,10 @@
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
<%- unless options.skip_sprockets? -%>
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
<%- end -%>
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false

View File

@@ -211,6 +211,13 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_no_match(/coffee-rails/, content)
assert_no_match(/uglifier/, content)
end
assert_file "config/environments/development.rb" do |content|
assert_no_match(/config\.assets\.debug = true/, content)
end
assert_file "config/environments/production.rb" do |content|
assert_no_match(/config\.assets\.digest = true/, content)
assert_no_match(/config\.assets\.compress = true/, content)
end
assert_file "test/performance/browsing_test.rb"
end