redis-semaphore 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +21 -0
- data/lib/redis/semaphore.rb +2 -2
- metadata +1 -1
data/README.md
CHANGED
@@ -94,6 +94,27 @@ Testing
|
|
94
94
|
$ bundle install
|
95
95
|
$ rake
|
96
96
|
|
97
|
+
Changelog
|
98
|
+
---------
|
99
|
+
|
100
|
+
###0.1.5 October 1, 2012
|
101
|
+
- Add detection of Redis::Namespace definition to avoid potential bug (thanks ruud!).
|
102
|
+
|
103
|
+
###0.1.4 October 1, 2012
|
104
|
+
- Fixed empty namespaces (thanks ruurd!).
|
105
|
+
|
106
|
+
###0.1.3 July 9, 2012
|
107
|
+
- Tokens are now identifiable (thanks timgaleckas!).
|
108
|
+
|
109
|
+
###0.1.2 June 1, 2012
|
110
|
+
- Add redis-namespace support (thanks neovintage!).
|
111
|
+
|
112
|
+
### 0.1.1 September 17, 2011
|
113
|
+
- When an exception is raised during locked period, ensure it unlocks.
|
114
|
+
|
115
|
+
### 0.1.0 August 4, 2011
|
116
|
+
- Initial release.
|
117
|
+
|
97
118
|
Author
|
98
119
|
------
|
99
120
|
|
data/lib/redis/semaphore.rb
CHANGED
@@ -68,11 +68,11 @@ class Redis
|
|
68
68
|
|
69
69
|
private
|
70
70
|
def list_name
|
71
|
-
@redis.is_a?(Redis::Namespace) ? "#{@name}:LIST" : "SEMAPHORE:#{@name}:LIST"
|
71
|
+
(defined?(Redis::Namespace) && @redis.is_a?(Redis::Namespace)) ? "#{@name}:LIST" : "SEMAPHORE:#{@name}:LIST"
|
72
72
|
end
|
73
73
|
|
74
74
|
def exists_name
|
75
|
-
@redis.is_a?(Redis::Namespace) ? "#{@name}:EXISTS" : "SEMAPHORE:#{@name}:EXISTS"
|
75
|
+
(defined?(Redis::Namespace) && @redis.is_a?(Redis::Namespace)) ? "#{@name}:EXISTS" : "SEMAPHORE:#{@name}:EXISTS"
|
76
76
|
end
|
77
77
|
|
78
78
|
def exists_or_create!
|