zk 1.7.5 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
1
1
  This file notes feature differences and bugfixes contained between releases.
2
2
 
3
+ ### v1.8.0 ###
4
+
5
+ * Added non-exploderating Locker#assert method (issue #48, h/t: johnbellone)
6
+
3
7
  ### v1.7.5 ###
4
8
 
5
9
  * fix for jruby 1.7 (issue #53)
@@ -280,6 +280,13 @@ module ZK
280
280
  end
281
281
  end
282
282
 
283
+ def assert
284
+ assert!
285
+ true
286
+ rescue LockAssertionFailedError
287
+ false
288
+ end
289
+
283
290
  private
284
291
  def lock_with_opts_hash(opts={})
285
292
  raise NotImplementedError
@@ -1,3 +1,3 @@
1
1
  module ZK
2
- VERSION = "1.7.5"
2
+ VERSION = "1.8.0"
3
3
  end
@@ -32,6 +32,13 @@ describe 'ZK::Client#locker' do
32
32
  @zk2.locker(@path_to_lock).lock.should be_false
33
33
  end
34
34
 
35
+ it "should assert properly if lock is acquired" do
36
+ @zk.locker(@path_to_lock).assert.should be_false
37
+ l = @zk2.locker(@path_to_lock)
38
+ l.lock.should be_true
39
+ l.assert.should be_true
40
+ end
41
+
35
42
  it "should be able to acquire the lock after the first one releases it" do
36
43
  lock1 = @zk.locker(@path_to_lock)
37
44
  lock2 = @zk2.locker(@path_to_lock)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zk
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 55
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 7
9
- - 5
10
- version: 1.7.5
8
+ - 8
9
+ - 0
10
+ version: 1.8.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jonathan D. Simms
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-12-20 00:00:00 Z
19
+ date: 2013-02-19 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: zookeeper
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  requirements: []
188
188
 
189
189
  rubyforge_project:
190
- rubygems_version: 1.8.24
190
+ rubygems_version: 1.8.25
191
191
  signing_key:
192
192
  specification_version: 3
193
193
  summary: A high-level wrapper around the zookeeper driver