teak_util 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +25 -27
- data/lib/teak_util/storage/s3.rb +19 -3
- data/lib/teak_util/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: 3e584658dc728de14032e9a66300a243cf9575faaf939da8a52ad8e4fb5fc557
|
4
|
+
data.tar.gz: ddd8a0b2fa4ed323c86240257c082a28315f534c92f16f57fd26c915d5d57708
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5397427c278a604b2d4326050c673a0f03c9b8f0a2b52379288862ae5d8b75aa396bb9dc9aea83fde2a75a2379518049afd04df9d8cc3b62b027a04b3b7086c5
|
7
|
+
data.tar.gz: 33150a644a227207e1c5db8308c64fd0e7acf2c7275a64baf3dce750d79a1b120249ee5bec9339af350e6aa24480b5e0288d5c4a6db046b15a37cd27eb817d1e
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
teak_util (0.1.
|
4
|
+
teak_util (0.1.3)
|
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.
|
14
|
-
activesupport (= 7.1.
|
15
|
-
activesupport (7.1.
|
13
|
+
activemodel (7.1.3.2)
|
14
|
+
activesupport (= 7.1.3.2)
|
15
|
+
activesupport (7.1.3.2)
|
16
16
|
base64
|
17
17
|
bigdecimal
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
@@ -22,41 +22,40 @@ GEM
|
|
22
22
|
minitest (>= 5.1)
|
23
23
|
mutex_m
|
24
24
|
tzinfo (~> 2.0)
|
25
|
-
aws-eventstream (1.
|
26
|
-
aws-partitions (1.
|
27
|
-
aws-sdk-core (3.
|
28
|
-
aws-eventstream (~> 1, >= 1.0
|
25
|
+
aws-eventstream (1.3.0)
|
26
|
+
aws-partitions (1.925.0)
|
27
|
+
aws-sdk-core (3.194.2)
|
28
|
+
aws-eventstream (~> 1, >= 1.3.0)
|
29
29
|
aws-partitions (~> 1, >= 1.651.0)
|
30
|
-
aws-sigv4 (~> 1.
|
30
|
+
aws-sigv4 (~> 1.8)
|
31
31
|
jmespath (~> 1, >= 1.6.1)
|
32
|
-
aws-sdk-kms (1.
|
33
|
-
aws-sdk-core (~> 3, >= 3.
|
32
|
+
aws-sdk-kms (1.80.0)
|
33
|
+
aws-sdk-core (~> 3, >= 3.193.0)
|
34
34
|
aws-sigv4 (~> 1.1)
|
35
|
-
aws-sdk-s3 (1.
|
36
|
-
aws-sdk-core (~> 3, >= 3.
|
35
|
+
aws-sdk-s3 (1.149.1)
|
36
|
+
aws-sdk-core (~> 3, >= 3.194.0)
|
37
37
|
aws-sdk-kms (~> 1)
|
38
|
-
aws-sigv4 (~> 1.
|
39
|
-
aws-sigv4 (1.
|
38
|
+
aws-sigv4 (~> 1.8)
|
39
|
+
aws-sigv4 (1.8.0)
|
40
40
|
aws-eventstream (~> 1, >= 1.0.2)
|
41
|
-
base64 (0.
|
42
|
-
bigdecimal (3.1.
|
43
|
-
business_flow (0.19.
|
41
|
+
base64 (0.2.0)
|
42
|
+
bigdecimal (3.1.8)
|
43
|
+
business_flow (0.19.4)
|
44
44
|
activemodel (>= 4.2, < 8)
|
45
45
|
activesupport (>= 4.2, < 8)
|
46
|
-
concurrent-ruby (1.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.
|
51
|
-
|
52
|
-
i18n (1.14.1)
|
50
|
+
drb (2.2.1)
|
51
|
+
i18n (1.14.5)
|
53
52
|
concurrent-ruby (~> 1.0)
|
54
53
|
jmespath (1.6.2)
|
55
|
-
mime-types (3.5.
|
54
|
+
mime-types (3.5.2)
|
56
55
|
mime-types-data (~> 3.2015)
|
57
|
-
mime-types-data (3.
|
58
|
-
minitest (5.
|
59
|
-
mutex_m (0.
|
56
|
+
mime-types-data (3.2024.0507)
|
57
|
+
minitest (5.22.3)
|
58
|
+
mutex_m (0.2.0)
|
60
59
|
rake (13.0.6)
|
61
60
|
rspec (3.12.0)
|
62
61
|
rspec-core (~> 3.12.0)
|
@@ -71,7 +70,6 @@ GEM
|
|
71
70
|
diff-lcs (>= 1.2.0, < 2.0)
|
72
71
|
rspec-support (~> 3.12.0)
|
73
72
|
rspec-support (3.12.1)
|
74
|
-
ruby2_keywords (0.0.5)
|
75
73
|
rubyzip (2.3.2)
|
76
74
|
simplecov (0.22.0)
|
77
75
|
docile (~> 1.1)
|
data/lib/teak_util/storage/s3.rb
CHANGED
@@ -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 =
|
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(
|
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,17 @@ 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
|
+
# Returns the name of the bucket.
|
73
|
+
def bucket_name
|
74
|
+
@bucket.name
|
75
|
+
end
|
76
|
+
|
77
|
+
private
|
78
|
+
|
79
|
+
def prefixed_path(key)
|
80
|
+
"#{@prefix}#{key}"
|
81
|
+
end
|
66
82
|
end
|
67
83
|
end
|
68
84
|
end
|
data/lib/teak_util/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.3
|
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-
|
11
|
+
date: 2024-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|