gem 'aws-sdk-s3' class S3Downloader VERSION = "1.1.0" attr_reader :download_location def initialize @s3_bucket_name = 'routes-for-radarr' @file_name = 'api_routes.yml' @s3_bucket_object = Aws::S3::Bucket.new(@s3_bucket_name).object(@file_name) @download_location = "/tmp/#{@file_name}" end def download_routes @s3_bucket_object.download_file(@download_location) unless check_for_existing_routes_file end def check_for_existing_routes_file File.exists?(@download_location) end end