google-cloud-storage-extension 0.1.0 → 0.1.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e534c19e20b5a6db4e2f9f79bc9829a51f376f7fb76bae29e73f72c7f42a508b
|
4
|
+
data.tar.gz: 9cd2c57a62f82b2e4c36026a2d5ca168c1127c2d705eff2ff398f53a28194768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce860ebe0c70cde977e5b3887f167e601996611cf8a277de547b7892a7d26d735a990ded5c6508d910f5533563060d6953ca92b4d129e8b031c64f0bcdf47a16
|
7
|
+
data.tar.gz: b0d54930de9a427a41ed93cced2d26f34d4ce4ab3c021e93cfb82ea066d63fcfb88d637eaec1b9a6c377ac21dc1caf1dfca9006504e202a5477aa0bbf48bf72b
|
@@ -13,14 +13,33 @@ module Google
|
|
13
13
|
# @yield [path]
|
14
14
|
# @yieldparam path [String] path of tempfile
|
15
15
|
def f(filename, mode: 0)
|
16
|
-
|
16
|
+
tries = 0
|
17
|
+
begin
|
18
|
+
file = self.file(filename)
|
19
|
+
rescue StandardError
|
20
|
+
tries += 1
|
21
|
+
retry if tries <= 5
|
22
|
+
|
23
|
+
raise
|
24
|
+
end
|
17
25
|
raise 'file not found' unless file
|
18
26
|
|
19
27
|
name = file.name
|
20
28
|
basename = ::File.basename(name, '.*')
|
21
29
|
extname = ::File.extname(name)
|
22
30
|
tempfile = ::Tempfile.create([basename, extname], mode:)
|
23
|
-
|
31
|
+
|
32
|
+
tries = 0
|
33
|
+
begin
|
34
|
+
file.download(tempfile.path)
|
35
|
+
rescue StandardError
|
36
|
+
tries += 1
|
37
|
+
retry if tries <= 5
|
38
|
+
|
39
|
+
::File.delete(tempfile.path)
|
40
|
+
raise
|
41
|
+
end
|
42
|
+
|
24
43
|
ret = yield(tempfile.path)
|
25
44
|
::File.delete(tempfile.path)
|
26
45
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-storage-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ishotihadus
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-storage
|