class Comodule::Deployment::Helper::Aws::S3::Service

Public Instance Methods

bucket() click to toggle source
# File lib/comodule/deployment/helper/aws/s3.rb, line 24
def bucket
  return @bucket if @bucket

  bucket_obj = s3.buckets[bucket_name]
  @bucket =
    if bucket_obj.exists?
      bucket_obj
    else
      s3.buckets.create(bucket_name)
    end
end
bucket_name() click to toggle source
# File lib/comodule/deployment/helper/aws/s3.rb, line 20
def bucket_name
  @bucket_name ||= config.s3_bucket
end
cloud_to_local(s3_path) click to toggle source
# File lib/comodule/deployment/helper/aws/s3.rb, line 40
def cloud_to_local(s3_path)
  s3_path.sub(%r|#{owner.name}/|, "#{owner.project_root}/")
end
local_to_cloud(local_path) click to toggle source
# File lib/comodule/deployment/helper/aws/s3.rb, line 36
def local_to_cloud(local_path)
  local_path.sub(%r|#{owner.project_root}/|, "#{owner.name}/")
end
local_to_public_url(local_path) click to toggle source
# File lib/comodule/deployment/helper/aws/s3.rb, line 48
def local_to_public_url(local_path)
  public_url local_to_cloud(local_path)
end
public_url(s3_path) click to toggle source
# File lib/comodule/deployment/helper/aws/s3.rb, line 44
def public_url(s3_path)
  s3.bucket[s3_path].public_url secure: true
end
s3() click to toggle source
# File lib/comodule/deployment/helper/aws/s3.rb, line 16
def s3
  @s3 ||= aws.s3
end