Skip to content

Commit

Permalink
Merge pull request #6 from Root-App/zack-support-data-upload
Browse files Browse the repository at this point in the history
Support Data upload
  • Loading branch information
martinza authored Feb 6, 2018
2 parents 9330945 + 058eb99 commit 9c98c30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/amazon/bucket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def upload_file(object_name, local_file_name, content_type: nil)
end
end

def upload_data(object_name, data)
@bucket.object(object_name).put(:body => data)
end

def download_file(object_name, local_file_name)
object = @bucket.object(object_name)
object.download_file(local_file_name)
Expand Down
4 changes: 4 additions & 0 deletions lib/amazon/fake_communicator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ def bucket.upload_file(object_name, local_file_name, content_type: nil)
@bucket_files[object_name] = File.read(local_file_name)
end

def bucket.upload_data(object_name, data)
@bucket_files[object_name] = data
end

def bucket.region
@region
end
Expand Down

0 comments on commit 9c98c30

Please sign in to comment.