distributed_mutex 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source :rubygems
2
+
3
+ gem 'activerecord'
4
+ gem 'mysql'
5
+
6
+ group :development do
7
+ gem "jeweler"
8
+ gem 'rspec'
9
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,44 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activemodel (3.1.1)
5
+ activesupport (= 3.1.1)
6
+ builder (~> 3.0.0)
7
+ i18n (~> 0.6)
8
+ activerecord (3.1.1)
9
+ activemodel (= 3.1.1)
10
+ activesupport (= 3.1.1)
11
+ arel (~> 2.2.1)
12
+ tzinfo (~> 0.3.29)
13
+ activesupport (3.1.1)
14
+ multi_json (~> 1.0)
15
+ arel (2.2.1)
16
+ builder (3.0.0)
17
+ diff-lcs (1.1.3)
18
+ git (1.3.0)
19
+ i18n (0.6.0)
20
+ jeweler (1.6.4)
21
+ bundler (~> 1.0)
22
+ git (>= 1.2.5)
23
+ rake
24
+ multi_json (1.0.3)
25
+ mysql (2.8.1)
26
+ rake (0.9.2.2)
27
+ rspec (2.6.0)
28
+ rspec-core (~> 2.6.0)
29
+ rspec-expectations (~> 2.6.0)
30
+ rspec-mocks (~> 2.6.0)
31
+ rspec-core (2.6.4)
32
+ rspec-expectations (2.6.0)
33
+ diff-lcs (~> 1.1.2)
34
+ rspec-mocks (2.6.0)
35
+ tzinfo (0.3.30)
36
+
37
+ PLATFORMS
38
+ ruby
39
+
40
+ DEPENDENCIES
41
+ activerecord
42
+ jeweler
43
+ mysql
44
+ rspec
data/README.rdoc CHANGED
@@ -26,6 +26,15 @@ To add the plugin to your rails project, add the following to your config/enviro
26
26
 
27
27
  config.gem(:distributed_mutex)
28
28
 
29
+ == Developing
30
+
31
+ Copy spec/config/database.stub to spec/config/database.yml and edit as needed for your mysql
32
+ installation.
33
+
34
+ gem install bundler
35
+ bundle install
36
+ rake spec
37
+
29
38
  == Copyright
30
39
 
31
40
  Author:: Birkir A. Barkarson <birkirb@stoicviking.net>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.3
1
+ 1.1.4
data/lib/mysql_mutex.rb CHANGED
@@ -35,7 +35,7 @@ class MySQLMutex < DistributedMutex
35
35
  Rails.logger.debug("MySQLMutex: GET_LOCK=#{get_lock}")
36
36
  end
37
37
 
38
- if '1' == get_lock
38
+ if 1 == get_lock.to_i
39
39
  increment_thread_lock_count
40
40
  true
41
41
  else
@@ -55,7 +55,7 @@ class MySQLMutex < DistributedMutex
55
55
  Rails.logger.debug("MySQLMutex: RELEASE_LOCK=#{lock_release}")
56
56
  end
57
57
 
58
- if '1' == lock_release
58
+ if 1 == lock_release.to_i
59
59
  decrement_thread_lock_count
60
60
  true
61
61
  else
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
  require 'global_mutex'
3
3
 
4
4
  describe GlobalMutex, 'when created with a key and timeout' do
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
  require 'mysql_mutex'
3
3
 
4
4
  describe MySQLMutex, 'with a lock on an open mysql connection' do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distributed_mutex
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 3
10
- version: 1.1.3
9
+ - 4
10
+ version: 1.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Birkir A. Barkarson
@@ -15,10 +15,65 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-17 00:00:00 +09:00
18
+ date: 2012-01-16 00:00:00 +09:00
19
19
  default_executable:
20
- dependencies: []
21
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: activerecord
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: mysql
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ type: :runtime
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: jeweler
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ type: :development
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
64
+ name: rspec
65
+ prerelease: false
66
+ requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ type: :development
76
+ version_requirements: *id004
22
77
  description: Framework for using a distributed mutex along with an implementation of a mutex stored on a MySQL database.
23
78
  email: birkirb@stoicviking.net
24
79
  executables: []
@@ -28,6 +83,8 @@ extensions: []
28
83
  extra_rdoc_files:
29
84
  - README.rdoc
30
85
  files:
86
+ - Gemfile
87
+ - Gemfile.lock
31
88
  - README.rdoc
32
89
  - Rakefile
33
90
  - VERSION