-
-
Save blinsay/0395f57d274e71057d01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def put(thing io, overwrite = false) | |
# NOTE: This is an extra call to S3. | |
if exists?(thing) && !overwrite | |
raise "Thing already exists in S3. Refusing to overwrite" | |
end | |
metadata = ObjectMetadata.new | |
metadata.content_length = io.size | |
@client.putObject(bucket, build_key(thing), io.to_inputstream, metadata) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment