Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Calls 'save' explicitly on Rackspace::File

... in order to allow for custom headers
  • Loading branch information...
commit e9e53046e7a7d6a2bdbab971c8cc2fd69bc314f4 1 parent 643d82b
@juwalter juwalter authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/asset_sync/storage.rb
View
9 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
Please sign in to comment.
Something went wrong with that request. Please try again.