Skip to content

Instantly share code, notes, and snippets.

@CodePint
Last active September 7, 2018 14:02
Show Gist options
  • Save CodePint/fc02aa99d7c09fff84caae9d436d0256 to your computer and use it in GitHub Desktop.
Save CodePint/fc02aa99d7c09fff84caae9d436d0256 to your computer and use it in GitHub Desktop.
require 'aws-sdk'
source_file = "movie.mp4"
input_root 'example_net/all/content/video'
client = Aws::S3::Client.new(stub_responses: true)
client.stub_responses(:get_object, -> (context) {
params = context.params
if ((params[:key] == source_file) && (params[:bucket] == input_root.split('/').first))
binding.pry
params[:key]
else
nil
end
})
result = client.get_object(bucket: "example_net", key: "movie.mp4")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment