Sha256: 8d1707c8a90e77cf852191a69f91c97c2f3fbd973c5fa33ebfc9f1b3dfa32352

Contents?: true

Size: 525 Bytes

Versions: 1

Compression:

Stored size: 525 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
s3_downloader-1.1.0 lib/s3_downloader.rb