We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b7c96eb commit 2120f4cCopy full SHA for 2120f4c
lib/image_optim/cache.rb
@@ -34,6 +34,7 @@ def fetch(original)
34
if optimized
35
tmp = FSPath.temp_file_path(digest, @cache_dir)
36
FileUtils.mv(optimized, tmp)
37
+ tmp.chmod(0o666 & ~File.umask)
38
tmp.rename(cached)
39
cached_path = CachePath.convert(cached)
40
spec/image_optim/cache_spec.rb
@@ -72,6 +72,9 @@
72
expect(FileUtils).to receive(:mv).with(optimized, tmp_file)
73
expect(tmp_file).to receive(:rename).with(cached)
74
75
+ allow(File).to receive(:umask).and_return(0o024)
76
+ expect(tmp_file).to receive(:chmod).with(0o642)
77
+
78
expect(cache.fetch(original){ optimized }).to eq(cached)
79
end
80
0 commit comments