with_advisory_lock 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -91,6 +91,11 @@ aren't going to be commonly applicable, and they can be a source of
91
91
 
92
92
  ## Changelog
93
93
 
94
+ ### 0.0.6
95
+
96
+ * Only require ActiveRecord >= 3.0.x
97
+ * Fixed MySQL error reporting
98
+
94
99
  ### 0.0.5
95
100
 
96
101
  * Asking for the currently acquired advisory lock doesn't re-ask for the lock now.
@@ -8,7 +8,7 @@ module WithAdvisoryLock
8
8
  unless lock_stack.empty?
9
9
  raise NestedAdvisoryLockError.new(
10
10
  "MySQL doesn't support nested Advisory Locks",
11
- lock_stack)
11
+ lock_stack.dup)
12
12
  end
13
13
  # Returns 1 if the lock was obtained successfully,
14
14
  # 0 if the attempt timed out (for example, because another client has
@@ -1,3 +1,3 @@
1
1
  module WithAdvisoryLock
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -17,12 +17,13 @@ describe "lock nesting" do
17
17
 
18
18
  it "raises errors with MySQL when acquiring nested lock" do
19
19
  skip if env_db != 'mysql'
20
- proc {
20
+ exc = proc {
21
21
  Tag.with_advisory_lock("first") do
22
22
  Tag.with_advisory_lock("second") do
23
23
  end
24
24
  end
25
25
  }.must_raise WithAdvisoryLock::NestedAdvisoryLockError
26
+ exc.lock_stack.must_equal %w(first)
26
27
  end
27
28
 
28
29
  it "supports nested advisory locks with !MySQL" do
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^test/})
18
18
  gem.require_paths = %w(lib)
19
19
 
20
- gem.add_runtime_dependency 'activerecord', '>= 3.2.0'
20
+ gem.add_runtime_dependency 'activerecord', '>= 3.0.0'
21
21
 
22
22
  gem.add_development_dependency 'rake'
23
23
  gem.add_development_dependency 'yard'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: with_advisory_lock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 3.2.0
21
+ version: 3.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 3.2.0
29
+ version: 3.0.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rake
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -215,7 +215,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
215
  version: '0'
216
216
  segments:
217
217
  - 0
218
- hash: -1188809411944032990
218
+ hash: -4256670677892025284
219
219
  required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  none: false
221
221
  requirements:
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
224
  version: '0'
225
225
  segments:
226
226
  - 0
227
- hash: -1188809411944032990
227
+ hash: -4256670677892025284
228
228
  requirements: []
229
229
  rubyforge_project:
230
230
  rubygems_version: 1.8.23