locky 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/locky/version.rb +1 -1
- data/lib/locky.rb +5 -3
- 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: 3175be064223f8910885f31dedef146ee2dcfd6d
|
4
|
+
data.tar.gz: 4b60fb8230056e04d5bff8865df94b5408a2e8d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08efe2542304e3b02a4c55752d9d8520f954a343782c0e1ba97ba58d9167a1298fcb8bd2a41dd8adb2df40d64e645b407085998f4e1fd4ea9c2b8d3362034d55
|
7
|
+
data.tar.gz: b92a1f667ff1d26e743397ec50e11fb1db2a9a620384150194c81f0de83da92736f5aaada1a6dc2320647ff35b0578e7626c95842f7b0557172ccfdcdf515fb0
|
data/lib/locky/version.rb
CHANGED
data/lib/locky.rb
CHANGED
@@ -12,9 +12,11 @@ class Locky
|
|
12
12
|
def lock(process)
|
13
13
|
raise Error, "#{name} already locked by #{locked_by}" if locked?
|
14
14
|
adapter[name] = process
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
begin
|
16
|
+
yield
|
17
|
+
ensure
|
18
|
+
adapter.delete name
|
19
|
+
end
|
18
20
|
end
|
19
21
|
|
20
22
|
def locked?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|