Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,7 +127,10 @@ def s3_protocol | |
# 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] | ||
file = Tempfile.new(path(style)) | ||
filename = path(style).split(".") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kylecrum
|
||
extname = File.extname(filename) | ||
This comment has been minimized.
Sorry, something went wrong.
r3ap3r2004
|
||
basename = File.basename(filename, extname) | ||
file = Tempfile.new(basename, extname) | ||
file.write(AWS::S3::S3Object.value(path(style), bucket_name)) | ||
file.rewind | ||
return file | ||
|
This is a bug waiting to happen. If path(style) returns something like /Some/Path/To/my.files/myfile.jpg then you end up with a 3 element array. Of course it doesn't really matter since the following two lines are also broken.