redic-pool 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWY0MzFlY2M4MWFjZTBkNmMwYzVlMjY5ZjI1NTUzZmE0OWQzMzg2Nw==
5
- data.tar.gz: !binary |-
6
- Y2Y1ZmM0NTQ0N2VlNjBlNDU3MmM2OWY0ZmVkYWNlZmI5OGEwN2M4NA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZWUzZmEyNGNmYjIzNGYyNzA3M2VlM2ZlZWY4NWZhMGE2ZjM2ZjZiYWMwNDFh
10
- MzZlMzMxMzZkYmUyZjA1ZTVkNzg5ZmNjOWNiYWJhMjQwNjE2ZWM3ZjdkM2Ew
11
- NmM4ZDQzNDMzZWQ0Y2ZmODA5YTk0YzY1YTE0OWVjYWUyNDcwOTk=
12
- data.tar.gz: !binary |-
13
- NjgxM2JjZGZlYjhlOGQzOGZhYTc1NTc0MWQzOTViNDg4OTFkOGM5YzRlZGYy
14
- OGNmMmVlY2Q2NTExZWYxOTA0MmQxOTUwM2FiM2JjNzc1NDg4YWJhNjkwZmJk
15
- NTAxYzM3OWU1ZGY4MWVjNmRlNzkyZDI3NWVkMDg4NmY2YjcxOWU=
2
+ SHA1:
3
+ metadata.gz: 009762daaafbffe5fe8d87e3e594aa72955a845b
4
+ data.tar.gz: 6a7693318646dfe81d076df7a99b9a14a19d9bce
5
+ SHA512:
6
+ metadata.gz: 3a24c4c4e23c90c9dd304096d3633683b6ac50d58ac604c993c55a09ab73e3b04e5d791948a5f38ba1a604d743766259cbe8c18ff348a6529439be2799d96b7f
7
+ data.tar.gz: 0fcb69ac9f2defbd23fa467ad6d36a6a75ff234e844418a750c421dae0c47572f42ed75d3197b8a3016a781928446a10a85a23730574aa9513e949353c006497
@@ -1,3 +1,9 @@
1
+ 1.0.1 - 2015-04-06
2
+ ==================
3
+
4
+ * Fixed a critical issue that prevented `Redic::Pool` objects from being used
5
+ across Ohm models. See https://github.com/soveran/ohm/issues/184.
6
+
1
7
  1.0.0 - 2013-12-27
2
8
  ==================
3
9
 
data/README.md CHANGED
@@ -18,3 +18,13 @@ Usage
18
18
 
19
19
  $redis.call("INFO", "clients")[/connected_clients:(\d+)/, 1]
20
20
  # => "10"
21
+
22
+ With Ohm
23
+ --------
24
+
25
+ Assuming you use Ohm 2.0+:
26
+
27
+ require "redic/pool"
28
+ require "ohm"
29
+
30
+ Ohm.redis = Redic::Pool.new(ENV["REDIS_URL"], size: 10)
@@ -2,7 +2,7 @@ require "connection_pool"
2
2
  require "redic"
3
3
 
4
4
  class Redic::Pool
5
- VERSION = "1.0.0"
5
+ VERSION = "1.0.1"
6
6
 
7
7
  attr :url
8
8
  attr :pool
@@ -31,7 +31,11 @@ class Redic::Pool
31
31
  client.queue(*args)
32
32
  end
33
33
 
34
- client.commit
34
+ result = client.commit
35
+
36
+ Thread.current[@id].clear
37
+
38
+ result
35
39
  end
36
40
  end
37
41
  end
@@ -6,6 +6,10 @@ class Post < Ohm::Model
6
6
  attribute :title
7
7
  end
8
8
 
9
+ class Comment < Ohm::Model
10
+ attribute :body
11
+ end
12
+
9
13
  setup do
10
14
  Ohm.redis = Redic::Pool.new("redis://localhost:9999")
11
15
  end
@@ -15,6 +19,7 @@ test "Pool - basic" do
15
19
  Thread.new(i) do |i|
16
20
  10.times do |j|
17
21
  Post.create(title: "Foo #{i} #{j}").id
22
+ Comment.create(body: "Bar #{i} #{j}").id
18
23
  end
19
24
  end
20
25
  end
@@ -33,6 +38,7 @@ test "Pool - basic" do
33
38
  Thread.new(i) do |i|
34
39
  10.times do |j|
35
40
  Post.all.to_a
41
+ Comment.all.to_a
36
42
  end
37
43
  end
38
44
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redic-pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damian Janowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-27 00:00:00.000000000 Z
11
+ date: 2015-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: redic
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cutest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description:
@@ -79,17 +79,17 @@ require_paths:
79
79
  - lib
80
80
  required_ruby_version: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ! '>='
82
+ - - '>='
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.0.0
92
+ rubygems_version: 2.4.6
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: A Redis connection pool using Redic.