mamiya 0.0.1.alpha15 → 0.0.1.alpha16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mamiya/storages/s3.rb +5 -0
- data/lib/mamiya/version.rb +1 -1
- data/spec/storages/s3_spec.rb +16 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 920552f4b202f9a35b63aea39b35e14d915940a1
|
4
|
+
data.tar.gz: b4fdae3e05fc5561bd467c6f612fce839162233e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a89852fb28f513be7f4c8847f330c0933bb3d454f20bb17c8e9fb28ae9b9a4469a9b0f137bf9d0f1d4ee1a67a1427a4705b37828385ae1594f177adf6b7f3aa
|
7
|
+
data.tar.gz: f4e421916e389a2bf7449db1ef5dbd49090111803c768034cdf682c10306736ef9750edbdacd88dd1a6773daa80fd32f2d71904bc8e6a449938b7e9929708f88
|
data/lib/mamiya/storages/s3.rb
CHANGED
@@ -60,11 +60,16 @@ module Mamiya
|
|
60
60
|
end
|
61
61
|
|
62
62
|
return Mamiya::Package.new(package_path)
|
63
|
+
|
64
|
+
rescue AlreadyFetched, NotFound => e
|
65
|
+
raise e
|
66
|
+
|
63
67
|
rescue Aws::S3::Errors::NoSuchKey
|
64
68
|
File.unlink package_path if package_path && File.exists?(package_path)
|
65
69
|
File.unlink meta_path if meta_path && File.exists?(meta_path)
|
66
70
|
|
67
71
|
raise NotFound
|
72
|
+
|
68
73
|
rescue Exception => e
|
69
74
|
File.unlink package_path if package_path && File.exists?(package_path)
|
70
75
|
File.unlink meta_path if meta_path && File.exists?(meta_path)
|
data/lib/mamiya/version.rb
CHANGED
data/spec/storages/s3_spec.rb
CHANGED
@@ -164,6 +164,14 @@ describe Mamiya::Storages::S3 do
|
|
164
164
|
fetch
|
165
165
|
}.to raise_error(Mamiya::Storages::Abstract::AlreadyFetched)
|
166
166
|
end
|
167
|
+
|
168
|
+
it "doesn't remove anything" do
|
169
|
+
begin
|
170
|
+
fetch
|
171
|
+
rescue Mamiya::Storages::Abstract::AlreadyFetched; end
|
172
|
+
|
173
|
+
expect(File.exist?(metafile)).to be_true
|
174
|
+
end
|
167
175
|
end
|
168
176
|
|
169
177
|
context "when tarball already exists" do
|
@@ -176,6 +184,14 @@ describe Mamiya::Storages::S3 do
|
|
176
184
|
fetch
|
177
185
|
}.to raise_error(Mamiya::Storages::Abstract::AlreadyFetched)
|
178
186
|
end
|
187
|
+
|
188
|
+
it "doesn't remove anything" do
|
189
|
+
begin
|
190
|
+
fetch
|
191
|
+
rescue Mamiya::Storages::Abstract::AlreadyFetched; end
|
192
|
+
|
193
|
+
expect(File.exist?(tarball)).to be_true
|
194
|
+
end
|
179
195
|
end
|
180
196
|
|
181
197
|
context "when name has .json" do
|