Make cacheing binary files friendly with Windows. Closes #1975.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2524 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Marcel Molina 2005-10-11 01:06:05 +00:00
parent 064842f516
commit 9025e5d47f
2 changed files with 4 additions and 2 deletions

@ -1,5 +1,7 @@
*SVN*
* Make cacheing binary files friendly with Windows. #1975. [Rich Olson]
* Convert boolean form options form the tag_helper. #809. [Michael Schuerig <michael@schuerig.de>]
* Fixed that an instance variable with the same name as a partial should be implicitly passed as the partial :object #2269 [court3nay]

@ -86,7 +86,7 @@ def cache_page(content, path)
benchmark "Cached page: #{page_cache_file(path)}" do
FileUtils.makedirs(File.dirname(page_cache_path(path)))
File.open(page_cache_path(path), "w+") { |f| f.write(content) }
File.open(page_cache_path(path), "wb+") { |f| f.write(content) }
end
end
@ -407,7 +407,7 @@ def initialize(cache_path)
def write(name, value, options = nil) #:nodoc:
ensure_cache_path(File.dirname(real_file_path(name)))
File.open(real_file_path(name), "w+") { |f| f.write(value) }
File.open(real_file_path(name), "wb+") { |f| f.write(value) }
rescue => e
Base.logger.error "Couldn't create cache directory: #{name} (#{e.message})" if Base.logger
end