Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Debug

  • Loading branch information...
commit 1a3a17250a08b4c2aa46d60f5478e5e5d2b3a6c4 1 parent f3bf1d7
@gmontard authored
Showing with 12 additions and 6 deletions.
  1. +12 −6 storage.rb
View
18 storage.rb
@@ -117,9 +117,12 @@ def exists?(style = default_style)
# 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))
- file.write(WAZ::Blobs::Container.find(container_name)[path(style)].value)
- file.rewind
+ if exists?(style)
+ file = Tempfile.new(path(style))
+ file.write(WAZ::Blobs::Container.find(container_name)[path(style)].value)
+ file.rewind
+ file
+ end
return file
end
@@ -261,9 +264,12 @@ def exists?(style = default_style)
# 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))
- file.write(WAZ::Blobs::Container.find(container_name)[path(style)].value)
- file.rewind
+ if exists?(style)
+ file = Tempfile.new(path(style))
+ file.write(WAZ::Blobs::Container.find(container_name)[path(style)].value)
+ file.rewind
+ file
+ end
return file
end
Please sign in to comment.
Something went wrong with that request. Please try again.