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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53114479afcfb77e10b908ebeb5a5782901da5e3
4
- data.tar.gz: 1a63e3ff7d3587fff5d7b993be8e64554c57667e
3
+ metadata.gz: 50f297c6ed5c5ab409f6d00f66a0c486c013c525
4
+ data.tar.gz: 34806102910c3f13163b4d2aab2369924571405b
5
5
  SHA512:
6
- metadata.gz: c0ee726d8786273725fb3062f288b0d4ac312c6a900afa19746218dcd74b45dc364b60a70dd25026666519e76e2837b725ccc5c6b400e8f5e7b74ae7ea6ff0fd
7
- data.tar.gz: c8ed47d57ff8c145cf50d66bdb00cedce5a40d7a2c7c461e1d5ec286a849578a20145c56f6853f6b148cfbaaca3c9b3047ef4d13b305572d6af66433869544ec
6
+ metadata.gz: c5c6d160ac201fbc645ddd39d8e3c461da39a90a2ea8e9512705d508ad51c66accbca98deaa62432a08db1f11c6256db347015dea148f9bffff8d41ef63f2e72
7
+ data.tar.gz: f84b2182fedcd9c7095a68a34dba3109b69ff301b818bf32d4eb77cad5f56ad6546f010141661011e5692e9a8ba46b15501d56d76eaace96fb88bbdd020812dc
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 2.2.2 / 2015-12-18
2
+
3
+ * Bug fixes
4
+
5
+ * Don't die if you pass a non-integer expires - round it
6
+
1
7
  2.2.1 / 2015-12-14
2
8
 
3
9
  * Bug fixes
@@ -13,11 +13,13 @@ module LockAndCache
13
13
  end
14
14
 
15
15
  def expires
16
- options['expires']
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
- options['nil_expires']
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
@@ -1,3 +1,3 @@
1
1
  module LockAndCache
2
- VERSION = '2.2.1'
2
+ VERSION = '2.2.2'
3
3
  end
@@ -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.1
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-14 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport