Skip to content

Instantly share code, notes, and snippets.

View naveena-s's full-sized avatar

Naveen Kumar H S naveena-s

View GitHub Profile
List files and folders of a bucket of S3 using prefix and delimiter in Ruby
Before we get started, it is important to know few things.
Amazon Simple Storage Service which is also known as Amazon S3 is highly scalable, secure object storage in the cloud. It is used to store and obtain any amount of data at any time and from anywhere on the web. Amazon S3 is mainly used for backup, faster retrieval and reduce in cost as the users have to only pay for the storage and the bandwith used.
Every data that is stored in s3 is considered as object and objects are stored in something called bucket. When you are uploading any file to s3, an object is being stored to the bucket in background. You can set permission to bucket about who can access it, create it or delete the bucket.
The first step is to create the s3 object with proper credentials
require 'byebug'
class Ccc
require 'fileutils'
def self.pdf path, link, index
FileUtils::mkdir_p "#{path}"
system ("wkhtmltopdf #{link} ~/Documents/athlet_data/#{path}/#{index}.pdf")
end
def self.generate_pdf hash_of_links