lock_and_cache 2.2.0 → 2.2.1

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: b4e54a34f87ae8639c3bca086131b48998817736
4
- data.tar.gz: 0063344db4cbe9d2cb01b2e192908810b2277822
3
+ metadata.gz: 53114479afcfb77e10b908ebeb5a5782901da5e3
4
+ data.tar.gz: 1a63e3ff7d3587fff5d7b993be8e64554c57667e
5
5
  SHA512:
6
- metadata.gz: f2fca5d12d2e52b3c3616d4ed529b994299e30c20d203f2084f31220930842264c3bbdcbbac5c8d8caba98ce086ca3d9092b21e03d1bf39d91a04511fd49bb69
7
- data.tar.gz: a22749c51adebc1e425a498ee3e4695bafb3512f3b5685d039ab2e04f3312957525f009c906060f172c6f225ff103017adeaf903af14231e2bad8ffae310f598
6
+ metadata.gz: c0ee726d8786273725fb3062f288b0d4ac312c6a900afa19746218dcd74b45dc364b60a70dd25026666519e76e2837b725ccc5c6b400e8f5e7b74ae7ea6ff0fd
7
+ data.tar.gz: c8ed47d57ff8c145cf50d66bdb00cedce5a40d7a2c7c461e1d5ec286a849578a20145c56f6853f6b148cfbaaca3c9b3047ef4d13b305572d6af66433869544ec
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 2.2.1 / 2015-12-14
2
+
3
+ * Bug fixes
4
+
5
+ * Construct key using the correct class name
6
+
1
7
  2.2.0 / 2015-11-15
2
8
 
3
9
  * Enhancements
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # LockAndCache
2
2
 
3
- [![Build Status](https://travis-ci.org/seamusabshere/lock_and_cache.svg?branch=master)](https://travis-ci.org/seamusabshere/lock_and_cache)
4
- [![Code Climate](https://codeclimate.com/github/seamusabshere/lock_and_cache/badges/gpa.svg)](https://codeclimate.com/github/seamusabshere/lock_and_cache)
5
- [![Dependency Status](https://gemnasium.com/seamusabshere/lock_and_cache.svg)](https://gemnasium.com/seamusabshere/lock_and_cache)
6
- [![Gem Version](https://badge.fury.io/rb/lock_and_cache.svg)](http://badge.fury.io/rb/lock_and_cache)
7
- [![Security](https://hakiri.io/github/seamusabshere/lock_and_cache/master.svg)](https://hakiri.io/github/seamusabshere/lock_and_cache/master)
8
- [![Inline docs](http://inch-ci.org/github/seamusabshere/lock_and_cache.svg?branch=master)](http://inch-ci.org/github/seamusabshere/lock_and_cache)
3
+ [![Build Status](https://travis-ci.org/seamusabshere/lock_and_cache.svg?branch=master&v=2.2.0)](https://travis-ci.org/seamusabshere/lock_and_cache)
4
+ [![Code Climate](https://codeclimate.com/github/seamusabshere/lock_and_cache/badges/gpa.svg?v=2.2.0)](https://codeclimate.com/github/seamusabshere/lock_and_cache)
5
+ [![Dependency Status](https://gemnasium.com/seamusabshere/lock_and_cache.svg?v=2.2.0)](https://gemnasium.com/seamusabshere/lock_and_cache)
6
+ [![Gem Version](https://badge.fury.io/rb/lock_and_cache.svg?v=2.2.0)](http://badge.fury.io/rb/lock_and_cache)
7
+ [![Security](https://hakiri.io/github/seamusabshere/lock_and_cache/master.svg?v=2.2.0)](https://hakiri.io/github/seamusabshere/lock_and_cache/master)
8
+ [![Inline docs](http://inch-ci.org/github/seamusabshere/lock_and_cache.svg?branch=master&v=2.2.0)](http://inch-ci.org/github/seamusabshere/lock_and_cache)
9
9
 
10
10
  Lock and cache using redis!
11
11
 
@@ -15,7 +15,7 @@ module LockAndCache
15
15
  #
16
16
  # Get a context object's class name, which is its own name if it's an object.
17
17
  def extract_class_name(context)
18
- (self.class == ::Class) ? self.name : self.class.name
18
+ (context.class == ::Class) ? context.name : context.class.name
19
19
  end
20
20
  end
21
21
 
@@ -1,3 +1,3 @@
1
1
  module LockAndCache
2
- VERSION = '2.2.0'
2
+ VERSION = '2.2.1'
3
3
  end
@@ -287,6 +287,16 @@ describe LockAndCache do
287
287
  expect(count).to eq(2)
288
288
  end
289
289
 
290
+ it 'can be nested' do
291
+ expect(LockAndCache.lock_and_cache('hello') do
292
+ LockAndCache.lock_and_cache('world') do
293
+ LockAndCache.lock_and_cache('privyet') do
294
+ 123
295
+ end
296
+ end
297
+ end).to eq(123)
298
+ end
299
+
290
300
  it "requires a key" do
291
301
  expect do
292
302
  LockAndCache.lock_and_cache 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.0
4
+ version: 2.2.1
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-11-15 00:00:00.000000000 Z
11
+ date: 2015-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport