Hmm. I'm not totally certain. I would expect to probably just return chunk
(without the *) and use the whole chunk, rather than chunk[0]. At the very
least I'd suspect chunk instead of chunk[0] as what you wanted. I'm not
super sure beyond that, but hopefully that helps you in the right direction
anyway.


On Fri, Jul 18, 2014 at 12:19 PM, Tim Lawrence <[email protected]>
wrote:

> Hi Geemus,
>
> apologies for digging up an ancient thread but I wonder if you can help?
> I am using this method with the Atmos provider to download blobs and it
> appears to have stopped working.
> The chunk never gets populated. If I modify the code to use file.body then
> it downloads fine. using the *chunk as below always gives be a 0 byte file.
>
> def download_from_blobstore(source_key, destination_path)
>         FileUtils.mkdir_p(File.dirname(destination_path))
>         File.open(destination_path, "w") do |file|
>           (@cdn || files).get(partitioned_key(source_key)) do |*chunk|
>             file.write(chunk[0])
>           end
>         end
>       end
>
>
> Thanks
>
> Tim
>
> --
> You received this message because you are subscribed to the Google Groups
> "ruby-fog" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to