outreach_gem 1.0.57 → 1.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/outreach-s3/ruby-upload-s3.rb +19 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2568f9276ebe9ffa271c36d35582cc6be434086368a3c546705ac6d6683de26
|
|
4
|
+
data.tar.gz: 61ae2d3315b0d4a7a7177b56fc989ecc4fb0ac38aee773cc3903176b81d2af42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d74f56a34fbd4c99f101ddc25752eabf1f81f56afb7df1a38bfb88ce903b7786cc86b3632890470d729799f38dbaf4346e36e2a6aa4c357da2bc45d455615884
|
|
7
|
+
data.tar.gz: ee0ff39ef9c2f4e44198231e87150f649d9a67796d11092a7395d654cafc58441e6831ee88be3cb01ab00db734c49b7be5c9077e525c2dfe14db78f2dde16cef
|
|
@@ -47,10 +47,10 @@ class OutreachUploadS3
|
|
|
47
47
|
return obj
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
# Retrieve an item from S3
|
|
50
|
+
# Retrieve an item from S3 and return it in memory
|
|
51
51
|
# @param [string] The key representing the item in the bucket
|
|
52
52
|
# @return [S3Object] Return the S3 Object if it exists, if not then nil
|
|
53
|
-
def
|
|
53
|
+
def getItemInRam(item_name)
|
|
54
54
|
if item_name.nil? or item_name.empty?
|
|
55
55
|
raise 'Cannot have an empty or nil item to retrieve from S3'
|
|
56
56
|
end
|
|
@@ -61,6 +61,23 @@ class OutreachUploadS3
|
|
|
61
61
|
return object
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
+
# Retrieve an item from S3 and return it on disk
|
|
65
|
+
# @param [string] The key representing the item in the bucket
|
|
66
|
+
# @return [S3Object] Return the S3 Object if it exists, if not then nil
|
|
67
|
+
def getItemOnDisk(item_name, file_path)
|
|
68
|
+
if item_name.nil? or item_name.empty?
|
|
69
|
+
raise 'Cannot have an empty or nil item to retrieve from S3'
|
|
70
|
+
end
|
|
71
|
+
object = @s3_client.get_object(
|
|
72
|
+
response_target: file_path,
|
|
73
|
+
bucket: @bucketName,
|
|
74
|
+
key: item_name)
|
|
75
|
+
if object.nil?
|
|
76
|
+
return nil
|
|
77
|
+
end
|
|
78
|
+
return object
|
|
79
|
+
end
|
|
80
|
+
|
|
64
81
|
# Delete the S3Object
|
|
65
82
|
# @param s3_object [S3Object] Delete the S3 Object from the bucket
|
|
66
83
|
# @raise RuntimeError object cannot be nil
|