stashify-aws-s3 1.0.0 → 1.1.0

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: e829c9cd4d6a20de8ba74954e9700c9264e94d6454b9a09c3a422bcadd6a5ebc
4
- data.tar.gz: a196a368b2bcca6df33f91445f03231795503855d41255c7fb00efcbed4af6c3
3
+ metadata.gz: e2d92f216c0ac762098278c4893270d42d7bb70fb9e5bf0877c2540c811b60fc
4
+ data.tar.gz: a3993a29801b0cc4ab4ca3861760ab1a75141d2f9d035bbd4462a3c9baa0232c
5
5
  SHA512:
6
- metadata.gz: 4f22f06f44dccd3110f1fc050ca867c00fa838c63746939e7f69860c774f4473893262d4b072c6bf869937f58ba4b9f0038d0a7046fbdf4a7da477fec6b763e8
7
- data.tar.gz: 6632d1f70f3144459e13bf448cacaf107371b8807cb4bdcfa235103735674350ff74a4d1618e8d3bc1e6841179f010a4e616347bf8bc907374285ff9d062e8e8
6
+ metadata.gz: 98ad66cbd51d5809df61c81bbe6fb584b0af056d90770679538e1c36f935162a5a4f9eca795041f88ddd8fc1a0487215101523bf19b6ef6ba91fb5b503421958
7
+ data.tar.gz: 8bd45401e6b9e7a8a6b20e5edcc051d90045beb1473993409ae74e3916e4c665330bdf3ed7a87a2c442ea84eb65ed7e4f4cb150cc786b70173ee7f8f7afb3abd
data/Gemfile CHANGED
@@ -17,4 +17,4 @@ gem "guard-rspec"
17
17
  gem "guard-rubocop"
18
18
 
19
19
  gem "byebug"
20
- gem "rantly"
20
+ gem "stashify-contract"
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stashify-aws-s3 (0.1.0)
4
+ stashify-aws-s3 (1.1.0)
5
5
  aws-sdk-s3 (~> 1.119.2)
6
- stashify (~> 3.0.0)
6
+ stashify (~> 3.1.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  ast (2.4.2)
12
12
  aws-eventstream (1.2.0)
13
- aws-partitions (1.738.0)
13
+ aws-partitions (1.739.0)
14
14
  aws-sdk-core (3.171.0)
15
15
  aws-eventstream (~> 1, >= 1.0.2)
16
16
  aws-partitions (~> 1, >= 1.651.0)
@@ -107,7 +107,10 @@ GEM
107
107
  parser (>= 3.2.1.0)
108
108
  ruby-progressbar (1.13.0)
109
109
  shellany (0.0.1)
110
- stashify (3.0.0)
110
+ stashify (3.1.0)
111
+ stashify-contract (1.0.1)
112
+ rantly (~> 2.0.0)
113
+ rspec (~> 3.0)
111
114
  thor (1.2.1)
112
115
  unicode-display_width (2.4.2)
113
116
 
@@ -121,11 +124,11 @@ DEPENDENCIES
121
124
  guard-rspec
122
125
  guard-rubocop
123
126
  rake (~> 13.0)
124
- rantly
125
127
  reek (~> 6.1.4)
126
128
  rspec (~> 3.0)
127
129
  rubocop (~> 1.21)
128
130
  stashify-aws-s3!
131
+ stashify-contract
129
132
 
130
133
  BUNDLED WITH
131
134
  2.2.33
@@ -3,7 +3,7 @@
3
3
  module Stashify
4
4
  module AWS
5
5
  module S3
6
- VERSION = "1.0.0"
6
+ VERSION = "1.1.0"
7
7
  end
8
8
  end
9
9
  end
@@ -14,6 +14,13 @@ module Stashify
14
14
  super(path: path)
15
15
  end
16
16
 
17
+ def parent
18
+ Stashify::Directory::AWS::S3.new(
19
+ bucket: @bucket,
20
+ path: ::File.dirname(path),
21
+ )
22
+ end
23
+
17
24
  def files
18
25
  @bucket.objects.map do |object|
19
26
  key = object.key
@@ -21,12 +28,6 @@ module Stashify
21
28
  end.compact
22
29
  end
23
30
 
24
- def ==(other)
25
- self.class == other.class && @bucket == other.bucket && path == other.path
26
- end
27
-
28
- private
29
-
30
31
  def directory?(name)
31
32
  @bucket.objects(prefix: path_of(name, "")).count.positive?
32
33
  end
@@ -35,13 +36,17 @@ module Stashify
35
36
  Stashify::Directory::AWS::S3.new(bucket: @bucket, path: path_of(name))
36
37
  end
37
38
 
38
- def file?(name)
39
+ def exists?(name)
39
40
  @bucket.object(::File.join(path, name)).exists?
40
41
  end
41
42
 
42
43
  def file(name)
43
44
  Stashify::File::AWS::S3.new(bucket: @bucket, path: ::File.join(path, name))
44
45
  end
46
+
47
+ def ==(other)
48
+ self.class == other.class && @bucket == other.bucket && path == other.path
49
+ end
45
50
  end
46
51
  end
47
52
  end
@@ -22,6 +22,10 @@ module Stashify
22
22
  def delete
23
23
  @bucket.object(path).delete
24
24
  end
25
+
26
+ def exists?
27
+ @bucket.object(path).exists?
28
+ end
25
29
  end
26
30
  end
27
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stashify-aws-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lambda Null
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-30 00:00:00.000000000 Z
11
+ date: 2023-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.0.0
33
+ version: 3.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 3.0.0
40
+ version: 3.1.0
41
41
  description: Interact with AWS S3 using the common building blocks provided by Stashify
42
42
  email:
43
43
  - lambda.null.42@gmail.com