Skip to content

Commit

Permalink
Merge pull request rails#3936 from guilleiguaran/skip-assets-options-…
Browse files Browse the repository at this point in the history
…when-sprockets-skipped

Skip assets options in environments files when --skip-sprockets is used
  • Loading branch information
wycats committed Dec 11, 2011
2 parents aa6aa9b + ea5a70a commit 75a9d88
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions railties/test/generators/app_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ def test_generator_if_skip_sprockets_is_given
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

Expand Down

0 comments on commit 75a9d88

Please sign in to comment.