Created
December 6, 2010 18:55
-
-
Save seangaffney/730724 to your computer and use it in GitHub Desktop.
Convert Tempfile to binary using binmode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Returns representation of the data of the file assigned to the given | |
# style, in the format most representative of the current storage. | |
def to_file style = default_style | |
return @queued_for_write[style] if @queued_for_write[style] | |
filename = path(style) | |
extname = File.extname(filename) | |
basename = File.basename(filename, extname) | |
file = Tempfile.new([basename, extname]) | |
file.binmode # Added | |
file.write(AWS::S3::S3Object.value(path(style), bucket_name)) | |
file.rewind | |
return file | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment