bfs 0.7.5 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bfs/bucket/in_mem.rb +5 -4
- data/lib/bfs/helpers.rb +6 -8
- data/spec/bfs/helpers_spec.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd67ecfdb038d1809be4193caf014dfd9e8bcba4e26a4cd04da3c64e61522ddc
|
4
|
+
data.tar.gz: 17586a9b02836e8bdcbf4da6bc822d9c169cca9823b5817357dba1d4a5f1a072
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1ab4426da76e5a0de997d9b1f355c549197e4bd199629a37f6f787a9dcd068020c04ed190f117461490bb75d86a4070b475d481cc679005de731dacabb8fd64
|
7
|
+
data.tar.gz: 355cd6811da84829fad5f59927535b681c3f357968681d175c8a400f4e0b445920120daba944ea679dc965b582d65781063e2be199ffc372cda4e7df6739f89c
|
data/lib/bfs/bucket/in_mem.rb
CHANGED
@@ -17,16 +17,17 @@ module BFS
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def close
|
20
|
-
|
21
|
-
|
20
|
+
super.tap do
|
21
|
+
@closer&.call(self)
|
22
|
+
end
|
22
23
|
end
|
23
24
|
|
24
25
|
def close!
|
25
26
|
__getobj__.close
|
26
27
|
end
|
27
28
|
|
28
|
-
def perform
|
29
|
-
return self unless
|
29
|
+
def perform
|
30
|
+
return self unless block_given?
|
30
31
|
|
31
32
|
begin
|
32
33
|
yield self
|
data/lib/bfs/helpers.rb
CHANGED
@@ -11,8 +11,8 @@ module BFS
|
|
11
11
|
super tempfile
|
12
12
|
end
|
13
13
|
|
14
|
-
def perform
|
15
|
-
return self unless
|
14
|
+
def perform
|
15
|
+
return self unless block_given?
|
16
16
|
|
17
17
|
begin
|
18
18
|
yield self
|
@@ -25,12 +25,10 @@ module BFS
|
|
25
25
|
def close
|
26
26
|
return if closed?
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
ensure
|
33
|
-
tempfile.unlink
|
28
|
+
super.tap do
|
29
|
+
@closer&.call(path)
|
30
|
+
end
|
31
|
+
unlink
|
34
32
|
end
|
35
33
|
end
|
36
34
|
end
|
data/spec/bfs/helpers_spec.rb
CHANGED
@@ -15,9 +15,10 @@ RSpec.describe BFS::TempWriter, core: true do
|
|
15
15
|
expect(subject.close).to be_truthy
|
16
16
|
end
|
17
17
|
|
18
|
-
it 'should
|
19
|
-
expect(closer).to receive(:call).with(subject.path)
|
18
|
+
it 'should execute a closer block' do
|
19
|
+
expect(closer).to receive(:call).with(subject.path).once
|
20
20
|
expect(subject.close).to be_truthy
|
21
|
+
expect(subject.close).to be_nil
|
21
22
|
end
|
22
23
|
|
23
24
|
it 'may skip closer block' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitrij Denissenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Minimalist abstraction for bucket storage
|
14
14
|
email: dimitrij@blacksquaremedia.com
|