Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure that enhancements to assets:precompile task are only run once

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 6f429f375e43529f2dd1a2f37cbaabeef40c6ea9 1 parent 0e1f7e0
@spohlenz spohlenz authored josevalim committed
View
2  actionpack/lib/sprockets/assets.rake
@@ -7,6 +7,7 @@ namespace :assets do
ENV["RAILS_GROUPS"] ||= "assets"
ENV["RAILS_ENV"] ||= "production"
ruby $0, *ARGV
+ exit
else
require "fileutils"
Rake::Task["tmp:cache:clear"].invoke
@@ -42,6 +43,7 @@ namespace :assets do
end
ENV["RAILS_ASSETS_NONDIGEST"] = "true"
ruby $0, *ARGV
+ exit
end
end
end
View
6 railties/test/application/assets_test.rb
@@ -419,6 +419,12 @@ class ::PostsController < ActionController::Base ; end
assert_equal "NoPost;\n", File.read("#{app_path}/public/assets/application.js")
end
+ test "enhancements to assets:precompile should only run once" do
+ app_file "lib/tasks/enhance.rake", "Rake::Task['assets:precompile'].enhance { puts 'enhancement' }"
+ output = precompile!
+ assert_equal 1, output.scan("enhancement").size
+ end
+
private
def app_with_assets_in_view
Please sign in to comment.
Something went wrong with that request. Please try again.