uc3-dmp-s3 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-s3/client.rb +3 -2
- data/lib/uc3-dmp-s3/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03efe791449211289f51da782f9dacf96b17603806b43bafd196c6d9ce8ddf90
|
4
|
+
data.tar.gz: 6a43ca699de4458f0090420886192bf3b7627241875a463d9e6c093bb135d4e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c14bbf7a03c2476e1521a5c47499edf2603def467bc24be8309f5ba7aeaf6c67e9023a0b6419c5e8561608c97b4c826234869b80736219e26347b98f414c4567
|
7
|
+
data.tar.gz: 2c01db4e521000aadb18285830d2007642310d4d882b9acda8454c071792c9e4a87cab6ce9528fca22eba1f8a194d0b5e753d0c38d864f74fbe71ad488851792
|
data/lib/uc3-dmp-s3/client.rb
CHANGED
@@ -20,7 +20,7 @@ module Uc3DmpS3
|
|
20
20
|
class Client
|
21
21
|
NARRATIVE_KEY_PREFIX = 'narratives/'
|
22
22
|
|
23
|
-
MSG_S3_FAILURE = 'Unable to save the
|
23
|
+
MSG_S3_FAILURE = 'Unable to save the object at this time'
|
24
24
|
|
25
25
|
class << self
|
26
26
|
# Put the narrative file into the S3 bucket
|
@@ -43,7 +43,8 @@ module Uc3DmpS3
|
|
43
43
|
def get_narrative(key:)
|
44
44
|
return nil unless key.is_a?(String) && !key.strip.empty? && !ENV['S3_BUCKET'].nil?
|
45
45
|
|
46
|
-
_get_object(key: key.start_with?(NARRATIVE_KEY_PREFIX) ? key : "#{NARRATIVE_KEY_PREFIX}#{key}")
|
46
|
+
obj = _get_object(key: key.start_with?(NARRATIVE_KEY_PREFIX) ? key : "#{NARRATIVE_KEY_PREFIX}#{key}")
|
47
|
+
Base64.encode64(obj)
|
47
48
|
rescue Aws::Errors::ServiceError => e
|
48
49
|
raise ClientError, "Unable to fetch PDF narrative from S3 bucket (key: #{key}) - #{e.message}"
|
49
50
|
end
|
data/lib/uc3-dmp-s3/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uc3-dmp-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Riley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|