Skip to content

Commit 3a2275a

Browse files
committed
Don't depend on Redis directly
1 parent 271a0d1 commit 3a2275a

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ gem "rake"
99
gem "rspec"
1010
gem "standard"
1111
gem "fakeredis"
12+
gem "redis"
1213
gem "connection_pool"

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ PATH
33
specs:
44
bigrails-redis (0.3.0)
55
rails (>= 6)
6-
redis (~> 4.0)
76

87
GEM
98
remote: https://rubygems.org/
@@ -206,6 +205,7 @@ DEPENDENCIES
206205
connection_pool
207206
fakeredis
208207
rake
208+
redis
209209
rspec
210210
standard
211211

bigrails-redis.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ Gem::Specification.new do |spec|
2222
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
2323

2424
spec.add_dependency "rails", ">= 6"
25-
spec.add_dependency "redis", "~> 4.0"
2625
end

lib/big_rails/redis/registry.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# frozen_string_literal: true
22

3-
require "redis"
4-
53
module BigRails
64
module Redis
75
class Registry
@@ -61,10 +59,10 @@ def build_connection(name)
6159
end
6260

6361
def build_wrapped_connection(connection)
64-
if connection.is_a?(::Redis)
65-
connection
66-
else
62+
if connection.is_a?(::ConnectionPool)
6763
::ConnectionPool.wrap(pool: connection)
64+
else
65+
connection
6866
end
6967
end
7068

0 commit comments

Comments
 (0)