saviour 0.4.9 → 0.4.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saviour/local_storage.rb +1 -1
- data/lib/saviour/version.rb +1 -1
- data/spec/models/local_storage_spec.rb +18 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8f60221415cb3f9496b915d56999f2404784dba
|
4
|
+
data.tar.gz: 9de5a6f7f39a3df2c15e72486915a60cd1cf7231
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2995d015c6a1f6b66278a85a953230c76ceba7cddc4e5fc5ba8cd76bbfd4dd53f760023e735fa06723f738da4bbd18a28e32d10bc73dab9ae53e380b41b48ec
|
7
|
+
data.tar.gz: ab58fec40cdaac44bc69bf529336c7e07065e924fd49b15eab39268d129bfaa791c553c34614d090adbf76a7d72c8d2bdcf9d939b759b8f77b8a6de74132fbd0
|
@@ -91,7 +91,7 @@ module Saviour
|
|
91
91
|
basedir = ::File.dirname(path)
|
92
92
|
return if basedir == "."
|
93
93
|
|
94
|
-
while basedir != "/" && Dir.entries(real_path(basedir)) - [".", ".."] ==[]
|
94
|
+
while basedir != "/" && basedir != "." && Dir.entries(real_path(basedir)) - [".", ".."] == []
|
95
95
|
Dir.rmdir(real_path(basedir))
|
96
96
|
basedir = ::File.dirname(basedir)
|
97
97
|
end
|
data/lib/saviour/version.rb
CHANGED
@@ -87,19 +87,27 @@ describe Saviour::LocalStorage do
|
|
87
87
|
end
|
88
88
|
|
89
89
|
it "does not leave an empty dir behind" do
|
90
|
-
|
91
|
-
|
90
|
+
final_path = File.join(@tmpdir, "some/folder/dest.jpg")
|
91
|
+
subject.write "Some contents", "some/folder/dest.jpg"
|
92
|
+
expect(File.file?(final_path)).to be_truthy
|
92
93
|
|
93
|
-
|
94
|
-
FileUtils.cp file.path, final_path
|
95
|
-
expect(File.file?(final_path)).to be_truthy
|
94
|
+
subject.delete("/some/folder/dest.jpg")
|
96
95
|
|
97
|
-
|
96
|
+
expect(File.file?(final_path)).to be_falsey
|
97
|
+
expect(File.directory?(File.join(@tmpdir, "some/folder"))).to be_falsey
|
98
|
+
expect(File.directory?(File.join(@tmpdir, "some"))).to be_falsey
|
99
|
+
end
|
98
100
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
101
|
+
it "does not leave an empty dir behind with relative paths" do
|
102
|
+
final_path = File.join @tmpdir, "some/folder/dest.jpg"
|
103
|
+
subject.write "Some contents", "some/folder/dest.jpg"
|
104
|
+
expect(File.file?(final_path)).to be_truthy
|
105
|
+
|
106
|
+
subject.delete("some/folder/dest.jpg")
|
107
|
+
|
108
|
+
expect(File.file?(final_path)).to be_falsey
|
109
|
+
expect(File.directory?(File.join(@tmpdir, "some/folder"))).to be_falsey
|
110
|
+
expect(File.directory?(File.join(@tmpdir, "some"))).to be_falsey
|
103
111
|
end
|
104
112
|
end
|
105
113
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saviour
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Campos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|