aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Lütke <tobias.luetke@gmail.com>2007-03-06 14:22:40 +0000
committerTobias Lütke <tobias.luetke@gmail.com>2007-03-06 14:22:40 +0000
commit3644415a1e0640cc4040489d1f5cb9ef0c85bca5 (patch)
tree4fa0bb73161c9a585798d2b7188d86ad1002c608
parentdbf42e379becc5612a0efe3476a999a9d6d803f0 (diff)
downloadrails-3644415a1e0640cc4040489d1f5cb9ef0c85bca5.tar.gz
rails-3644415a1e0640cc4040489d1f5cb9ef0c85bca5.tar.bz2
rails-3644415a1e0640cc4040489d1f5cb9ef0c85bca5.zip
Cached versions of concatted js/css asset tags have to be written out atomically.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6351 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
index 8b9e4094ce..a4843843d7 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -147,9 +147,9 @@ module ActionView
joined_javascript_path = File.join(JAVASCRIPTS_DIR, joined_javascript_name)
if !File.exists?(joined_javascript_path)
- File.open(joined_javascript_path, "w+") do |cache|
+ File.atomic_write(joined_javascript_path, File.dirname(joined_javascript_path)) do |cache|
javascript_paths = expand_javascript_sources(sources).collect do |source|
- compute_public_path(source, 'javascripts', 'js', false)
+ compute_public_path(source, 'javascripts', 'js')
end
cache.write(join_asset_file_contents(javascript_paths))
@@ -242,9 +242,9 @@ module ActionView
joined_stylesheet_path = File.join(STYLESHEETS_DIR, joined_stylesheet_name)
if !File.exists?(joined_stylesheet_path)
- File.open(joined_stylesheet_path, "w+") do |cache|
+ File.atomic_write(joined_stylesheet_path, File.dirname(joined_stylesheet_path)) do |cache|
stylesheet_paths = expand_stylesheet_sources(sources).collect do |source|
- compute_public_path(source, 'stylesheets', 'css', false)
+ compute_public_path(source, 'stylesheets', 'css')
end
cache.write(join_asset_file_contents(stylesheet_paths))