johnnyhalife / waz-storage

A simple implementation of Windows Azure Storage API for Ruby, inspired by the S3 gems and self experience of dealing with queues. The major goal of the whole gem is to enable ruby developers [like me =)] to leverage Windows Azure Storage features and have another option for cloud storage.
http://waz-storage.heroku.com
MIT License
40 stars 21 forks source link

set_blob_metadata #7

Closed marios closed 13 years ago

marios commented 13 years ago

Hi Jonny,

please include this minor fix for blob metadata. There was no implementation for the 'set blob_metadata' call. At first sight this might seem a non problem since there's a 'set_blob_properties' call. However, if you use this and don't set 'content_type' on the blob then the content_type gets removed alltogether.

This then causes things to blow up since you have in '/lib/waz/blobs/blob_object.rb' line 47 you have: 47 raise WAZ::Storage::InvalidOption, :content_type unless options.keys.include?(:content_type) and !options[:content_type].empty?

This in itself is another issue, i mean, is it really dictated by the azure api that content_type is an absolute requirement (e.g. see http://msdn.microsoft.com/en-us/library/dd179451.aspx - i read that as content_type being optional).

Anyway, if you include the 'set_blob_metadata' calls then only the user_metadata gets overwritten (and things like content_type aren't touched at all),

thanks!

marios

johnnyhalife commented 13 years ago

merged =)

marios commented 13 years ago

Awesome, thanks for doing this so quickly. I'll play with this at some point today/this week,

thanks again, marios