Module: ClusterFuck::S3Methods
Defined Under Namespace
Classes: ConflictError, KeyDoesNotExistError
Instance Method Summary
collapse
Instance Method Details
#all_files ⇒ Object
27
28
29
|
# File 'lib/cluster-fuck/s3_methods.rb', line 27
def all_files
bucket.objects.with_prefix(amicus_env).collect(&:key)
end
|
#amicus_env ⇒ Object
35
36
37
|
# File 'lib/cluster-fuck/s3_methods.rb', line 35
def amicus_env
@amicus_env || ClusterFuck.amicus_env
end
|
#bucket ⇒ Object
11
12
13
|
# File 'lib/cluster-fuck/s3_methods.rb', line 11
def bucket
@bucket ||= s3.buckets[CONFIG_BUCKET]
end
|
#credentials ⇒ Object
15
16
17
|
# File 'lib/cluster-fuck/s3_methods.rb', line 15
def credentials
@credentials ||= CredentialGrabber.find
end
|
#full_s3_path(key) ⇒ Object
31
32
33
|
# File 'lib/cluster-fuck/s3_methods.rb', line 31
def full_s3_path(key)
"#{amicus_env}/#{key}"
end
|
#s3 ⇒ Object
19
20
21
22
23
24
25
|
# File 'lib/cluster-fuck/s3_methods.rb', line 19
def s3
if credentials
AWS::S3.new(credentials) else
AWS::S3.new
end
end
|
#s3_object(object_name) ⇒ Object
7
8
9
|
# File 'lib/cluster-fuck/s3_methods.rb', line 7
def s3_object(object_name)
bucket.objects[full_s3_path(object_name)]
end
|