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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 012b85ca0ad4be2d1cc1ee135f15198316202b5ff52f8192831838fd62f576a4
4
- data.tar.gz: ca34a6e7221a1290f8a50224b60c5e2b33255b5a348460c5cb43d7fc52f596cd
3
+ metadata.gz: 03efe791449211289f51da782f9dacf96b17603806b43bafd196c6d9ce8ddf90
4
+ data.tar.gz: 6a43ca699de4458f0090420886192bf3b7627241875a463d9e6c093bb135d4e6
5
5
  SHA512:
6
- metadata.gz: ad81d5cc37ffccafdcebb9e8d7c695055e2b929ae401f807f207d9599b93101114dc5f514fb732ece2b4743556c8bf8ef726c3364d31598b7b8981852701302c
7
- data.tar.gz: 35d294452bbd39c6f183cdd9f57d3698f12a799c085bd11d4a585b2aad4fb4fdf33e1cf1f42cf15abac4f163ca6548209532f52bd71759b5f4241f35fabad9c5
6
+ metadata.gz: c14bbf7a03c2476e1521a5c47499edf2603def467bc24be8309f5ba7aeaf6c67e9023a0b6419c5e8561608c97b4c826234869b80736219e26347b98f414c4567
7
+ data.tar.gz: 2c01db4e521000aadb18285830d2007642310d4d882b9acda8454c071792c9e4a87cab6ce9528fca22eba1f8a194d0b5e753d0c38d864f74fbe71ad488851792
@@ -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 PDF file at this time'
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpS3
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
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.1
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-16 00:00:00.000000000 Z
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