stashify-google-cloud-storage 2.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11a1b4e3d6271334339801df4cc14ab52dd9ea133353403dcaeb67fa404f7bd7
4
- data.tar.gz: feb8d7a492fbd7b977f7aebcfda8278e672e61901d29668b8b4d2910254f3d04
3
+ metadata.gz: 13c38a2c3e9b7459ce0c579ce8811bed99d9e982d8d3560cb14c866f3f19cf2c
4
+ data.tar.gz: 8ae15cf5d924de45be2dedb43ab52a455e8fd374dd239b82d325c81e9ad8572a
5
5
  SHA512:
6
- metadata.gz: b1118fa70a4dd0cf35d74da52ba73e67546c34bed51c51d7b68faf754e567ea4bec6b55d523d965947a03275092e94c36e4e9468ebe892a3b9c285cca554fa02
7
- data.tar.gz: 975cba75a181ee2de498ffb4c0a9c05d56c3a28aa0e746c515d99cfc6587a648fe5c3fcdaa270726acb16098f192ebca8702d6947dfa5d48e06654b2d3c1e9aa
6
+ metadata.gz: aca97733dfa8377147faf342fbfd221a116a96540a854f90235e67ea02c9e9295267df864e57047914d5e85c13d396b69b5582ba9117d33072fc70444efd74eb
7
+ data.tar.gz: c18f6614c5d47e13fd920ff45afe6895d7a53334b1203f10ed0cb886a2999fb443333ba9e6319b8f3be0133b3287f5a2ea93df3c9451672831b6304dedf14c07
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,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stashify-google-cloud-storage (2.0.0)
4
+ stashify-google-cloud-storage (3.1.0)
5
5
  google-cloud-storage (~> 1.44.0)
6
- stashify (~> 2.1.1)
6
+ stashify (~> 3.1.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.8.1)
11
+ addressable (2.8.2)
12
12
  public_suffix (>= 2.0.2, < 6.0)
13
13
  ast (2.4.2)
14
14
  byebug (11.1.3)
@@ -127,7 +127,7 @@ GEM
127
127
  rspec-expectations (3.12.2)
128
128
  diff-lcs (>= 1.2.0, < 2.0)
129
129
  rspec-support (~> 3.12.0)
130
- rspec-mocks (3.12.4)
130
+ rspec-mocks (3.12.5)
131
131
  diff-lcs (>= 1.2.0, < 2.0)
132
132
  rspec-support (~> 3.12.0)
133
133
  rspec-support (3.12.0)
@@ -151,7 +151,10 @@ GEM
151
151
  faraday (>= 0.17.5, < 3.a)
152
152
  jwt (>= 1.5, < 3.0)
153
153
  multi_json (~> 1.10)
154
- stashify (2.1.1)
154
+ stashify (3.1.0)
155
+ stashify-contract (1.0.1)
156
+ rantly (~> 2.0.0)
157
+ rspec (~> 3.0)
155
158
  thor (1.2.1)
156
159
  trailblazer-option (0.1.2)
157
160
  uber (0.1.0)
@@ -168,10 +171,10 @@ DEPENDENCIES
168
171
  guard-rspec
169
172
  guard-rubocop
170
173
  rake (~> 13.0)
171
- rantly
172
174
  reek (~> 6.1.4)
173
175
  rspec (~> 3.0)
174
176
  rubocop (~> 1.21)
177
+ stashify-contract
175
178
  stashify-google-cloud-storage!
176
179
 
177
180
  BUNDLED WITH
@@ -16,29 +16,19 @@ module Stashify
16
16
  super(path: path)
17
17
  end
18
18
 
19
- def write_file(file)
20
- @bucket.create_file(
21
- StringIO.new(file.contents),
22
- path_of(file.name),
19
+ def parent
20
+ Stashify::Directory::Google::Cloud::Storage.new(
21
+ bucket: @bucket,
22
+ path: ::File.dirname(path),
23
23
  )
24
24
  end
25
25
 
26
- def delete_file(name)
27
- @bucket.file(path_of(name)).delete
28
- end
29
-
30
26
  def files
31
27
  @bucket.files.map do |gcloud_file|
32
28
  find(::Regexp.last_match(1)) if gcloud_file.name =~ %r{^#{Regexp.escape(path)}/([^/]*)(/.*)?$}
33
29
  end.compact
34
30
  end
35
31
 
36
- def ==(other)
37
- self.class == other.class && @bucket == other.bucket && path == other.path
38
- end
39
-
40
- private
41
-
42
32
  def directory?(name)
43
33
  path = path_of(name)
44
34
  !@bucket.file(path) && !@bucket.files(prefix: path).empty?
@@ -48,13 +38,17 @@ module Stashify
48
38
  Stashify::Directory::Google::Cloud::Storage.new(bucket: @bucket, path: path_of(name))
49
39
  end
50
40
 
51
- def file?(name)
41
+ def exists?(name)
52
42
  @bucket.file(path_of(name))
53
43
  end
54
44
 
55
45
  def file(name)
56
46
  Stashify::File::Google::Cloud::Storage.new(bucket: @bucket, path: path_of(name))
57
47
  end
48
+
49
+ def ==(other)
50
+ self.class == other.class && @bucket == other.bucket && path == other.path
51
+ end
58
52
  end
59
53
  end
60
54
  end
@@ -15,6 +15,21 @@ module Stashify
15
15
  def contents
16
16
  @bucket.file(path).download.string
17
17
  end
18
+
19
+ def write(contents)
20
+ @bucket.create_file(
21
+ StringIO.new(contents),
22
+ path,
23
+ )
24
+ end
25
+
26
+ def delete
27
+ @bucket.file(path).delete
28
+ end
29
+
30
+ def exists?
31
+ @bucket.file(path)
32
+ end
18
33
  end
19
34
  end
20
35
  end
@@ -4,7 +4,7 @@ module Stashify
4
4
  module Google
5
5
  module Cloud
6
6
  module Storage
7
- VERSION = "2.0.0"
7
+ VERSION = "3.1.0"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stashify-google-cloud-storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.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: google-cloud-storage
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.1.1
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: 2.1.1
40
+ version: 3.1.0
41
41
  description: Interact with Google Cloud Storage using the common building blocks provided
42
42
  by Stashify
43
43
  email: