Created
June 11, 2016 21:50
-
-
Save jrsa/f210b528b4ced5174abf28632e10e548 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
#! /usr/bin/env ruby | |
require 'aws/s3' | |
include AWS::S3 | |
# set these ENVs for connection | |
id = ENV['AMAZON_ACCESS_KEY_ID'] | |
key = ENV['AMAZON_SECRET_ACCESS_KEY'] | |
Base.establish_connection!(access_key_id: id, secret_access_key: key) | |
bucket = Bucket.find(ARGV[1]) | |
results = bucket.objects.select do |ob| | |
ob.key[ARGV[0]] | |
end | |
puts results.inspect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment