lock_and_cache 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/lib/lock_and_cache/action.rb +4 -2
- data/lib/lock_and_cache/version.rb +1 -1
- data/spec/lock_and_cache_spec.rb +4 -0
- 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: 50f297c6ed5c5ab409f6d00f66a0c486c013c525
|
4
|
+
data.tar.gz: 34806102910c3f13163b4d2aab2369924571405b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5c6d160ac201fbc645ddd39d8e3c461da39a90a2ea8e9512705d508ad51c66accbca98deaa62432a08db1f11c6256db347015dea148f9bffff8d41ef63f2e72
|
7
|
+
data.tar.gz: f84b2182fedcd9c7095a68a34dba3109b69ff301b818bf32d4eb77cad5f56ad6546f010141661011e5692e9a8ba46b15501d56d76eaace96fb88bbdd020812dc
|
data/CHANGELOG
CHANGED
@@ -13,11 +13,13 @@ module LockAndCache
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def expires
|
16
|
-
|
16
|
+
return @expires if defined?(@expires)
|
17
|
+
@expires = options.has_key?('expires') ? options['expires'].to_f.round : nil
|
17
18
|
end
|
18
19
|
|
19
20
|
def nil_expires
|
20
|
-
|
21
|
+
return @nil_expires if defined?(@nil_expires)
|
22
|
+
@nil_expires = options.has_key?('nil_expires') ? options['nil_expires'].to_f.round : nil
|
21
23
|
end
|
22
24
|
|
23
25
|
def digest
|
data/spec/lock_and_cache_spec.rb
CHANGED
@@ -287,6 +287,10 @@ describe LockAndCache do
|
|
287
287
|
expect(count).to eq(2)
|
288
288
|
end
|
289
289
|
|
290
|
+
it "allows float expiry" do
|
291
|
+
expect{LockAndCache.lock_and_cache('hello', expires: 1.5) {}}.not_to raise_error
|
292
|
+
end
|
293
|
+
|
290
294
|
it 'can be nested' do
|
291
295
|
expect(LockAndCache.lock_and_cache('hello') do
|
292
296
|
LockAndCache.lock_and_cache('world') do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lock_and_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seamus Abshere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|