teak_util 0.1.1 → 0.1.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: d2430a7886e8120a736af405b4365222cb623f2a500d2e7fc6cd6fd954bc02de
4
- data.tar.gz: 4b866e13745f013bc2b2bd30dc2109fa2e3c995fd0f62f889aa652c42ba91ad2
3
+ metadata.gz: 92731ed522f798d250b3b9b317c92ba9f17eb3dba21574235fefe7d1938de729
4
+ data.tar.gz: cad15ef3aa288b56a26574741d6bd22b2fe1377fcd3846656f7d9255ac5ba1d7
5
5
  SHA512:
6
- metadata.gz: f873faf295b30ab22b682b4e2d92413b9d4b504670e4c614a0dba960e29d849cc7f34336cf08d77b69846d3bd6c0be9ba4ce9397fa0d60587abbe561e0e65578
7
- data.tar.gz: 47c3c1629dd4341b23163b64f57f6ee0d3c9bb926f4ea60601a428c1d951c67876a2aca6cb06c08fa43f26322999c4307a199eb444569a402c56abba316469af
6
+ metadata.gz: 1b6cd53052c02325944ce90f837c085e4fe0bf1ebc5b27c565f4714be5b84308405cec3b0a57fa4e05ad49c4ed9b7f6b803fbf6f96152eebffcc8340b47a625c
7
+ data.tar.gz: 6cef854be60d4fdc20453e421f158bd4201eaae51c1ae165c392ce76f0171e27f9c81374284ccab7f59263c02db6edcb33dc9e697c588bab4c6f81c15139ea08
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.1.2
2
+
3
+ ENHANCEMENTS:
4
+
5
+ * Added Storage::S3#del to delete objects from S3.
6
+
1
7
  ## 0.1.1
2
8
 
3
9
  ENHANCEMENTS:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- teak_util (0.1.1)
4
+ teak_util (0.1.2)
5
5
  aws-sdk-s3 (>= 1.102)
6
6
  business_flow (>= 0.18.0)
7
7
  mime-types (>= 3)
@@ -10,9 +10,9 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activemodel (7.1.1)
14
- activesupport (= 7.1.1)
15
- activesupport (7.1.1)
13
+ activemodel (7.1.2)
14
+ activesupport (= 7.1.2)
15
+ activesupport (7.1.2)
16
16
  base64
17
17
  bigdecimal
18
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -22,41 +22,41 @@ GEM
22
22
  minitest (>= 5.1)
23
23
  mutex_m
24
24
  tzinfo (~> 2.0)
25
- aws-eventstream (1.2.0)
26
- aws-partitions (1.834.0)
27
- aws-sdk-core (3.185.1)
28
- aws-eventstream (~> 1, >= 1.0.2)
25
+ aws-eventstream (1.3.0)
26
+ aws-partitions (1.880.0)
27
+ aws-sdk-core (3.190.2)
28
+ aws-eventstream (~> 1, >= 1.3.0)
29
29
  aws-partitions (~> 1, >= 1.651.0)
30
- aws-sigv4 (~> 1.5)
30
+ aws-sigv4 (~> 1.8)
31
31
  jmespath (~> 1, >= 1.6.1)
32
- aws-sdk-kms (1.72.0)
33
- aws-sdk-core (~> 3, >= 3.184.0)
32
+ aws-sdk-kms (1.76.0)
33
+ aws-sdk-core (~> 3, >= 3.188.0)
34
34
  aws-sigv4 (~> 1.1)
35
- aws-sdk-s3 (1.136.0)
36
- aws-sdk-core (~> 3, >= 3.181.0)
35
+ aws-sdk-s3 (1.142.0)
36
+ aws-sdk-core (~> 3, >= 3.189.0)
37
37
  aws-sdk-kms (~> 1)
38
- aws-sigv4 (~> 1.6)
39
- aws-sigv4 (1.6.0)
38
+ aws-sigv4 (~> 1.8)
39
+ aws-sigv4 (1.8.0)
40
40
  aws-eventstream (~> 1, >= 1.0.2)
41
- base64 (0.1.1)
42
- bigdecimal (3.1.4)
41
+ base64 (0.2.0)
42
+ bigdecimal (3.1.5)
43
43
  business_flow (0.19.3)
44
44
  activemodel (>= 4.2, < 8)
45
45
  activesupport (>= 4.2, < 8)
46
- concurrent-ruby (1.2.2)
46
+ concurrent-ruby (1.2.3)
47
47
  connection_pool (2.4.1)
48
48
  diff-lcs (1.5.0)
49
49
  docile (1.4.0)
50
- drb (2.1.1)
50
+ drb (2.2.0)
51
51
  ruby2_keywords
52
52
  i18n (1.14.1)
53
53
  concurrent-ruby (~> 1.0)
54
54
  jmespath (1.6.2)
55
- mime-types (3.5.1)
55
+ mime-types (3.5.2)
56
56
  mime-types-data (~> 3.2015)
57
- mime-types-data (3.2023.1003)
58
- minitest (5.20.0)
59
- mutex_m (0.1.2)
57
+ mime-types-data (3.2023.1205)
58
+ minitest (5.21.1)
59
+ mutex_m (0.2.0)
60
60
  rake (13.0.6)
61
61
  rspec (3.12.0)
62
62
  rspec-core (~> 3.12.0)
@@ -38,7 +38,7 @@ module TeakUtil
38
38
  # @option opts [String] :content_type A standard MIME type describing the format of the contents.
39
39
  # @option opts [String] :content_disposition Specifies presentational information for the object.
40
40
  def put(key, value, opts = {})
41
- path = "#{@prefix}#{key}"
41
+ path = prefixed_path(key)
42
42
  @bucket.object(path).put(
43
43
  opts.merge(@put_opts.merge(body: value))
44
44
  )
@@ -48,14 +48,19 @@ module TeakUtil
48
48
  # Retrieves the value stored at key
49
49
  # @param key [String]
50
50
  def get(key)
51
- path = "#{@prefix}#{key}"
52
51
  begin
53
- @bucket.object(path).get.body.read
52
+ @bucket.object(prefixed_path(key)).get.body.read
54
53
  rescue Aws::S3::Errors::NoSuchKey
55
54
  return nil
56
55
  end
57
56
  end
58
57
 
58
+ # Deletes the value stored at key
59
+ # @param key [String]
60
+ def del(key)
61
+ @bucket.object(prefixed_path(key)).delete
62
+ end
63
+
59
64
  # Returns a URL which allows public access to the data stored at key
60
65
  # @param expires_in [Fixnum] number of seconds the link will remain valid for
61
66
  # Maximum is 604800 (1 week).
@@ -63,6 +68,12 @@ module TeakUtil
63
68
  path = "#{@prefix}#{key}"
64
69
  @bucket.object(path).presigned_url(:get, expires_in: expires_in.to_i)
65
70
  end
71
+
72
+ private
73
+
74
+ def prefixed_path(key)
75
+ "#{@prefix}#{key}"
76
+ end
66
77
  end
67
78
  end
68
79
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TeakUtil
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teak_util
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Scarborough
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-15 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3