Permalink
Browse files

Merge pull request #1 from juwalter/master

With old version of fog - needs to use file#save for custom headers
  • Loading branch information...
cfcosta committed Dec 5, 2012
2 parents 643d82b + e9e5304 commit fc6d98b0b84bacb3645c286ab2ec9eb9457d6a95
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/asset_sync/storage.rb
@@ -154,14 +154,17 @@ def upload_file(f)
log "Uploading: #{f}"
end
- bucket.files.create(file) unless ignore
+ unless ignore
+ file_object = bucket.files.new(file)
+ file_object.save(custom_headers(file))
+ end
end
- def add_custom_headers(file)
+ def custom_headers(file)
headers = config.custom_headers.select { |(key, _)| file[:key] =~ key }
return unless headers
- headers.values.each { |h| file.merge! h }
+ headers.values.inject({}) {|hsh,v| hsh.merge!(v); hsh }
end
def upload_files

0 comments on commit fc6d98b

Please sign in to comment.