redis 3.3.3 → 3.3.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2c3925815d6e2759b4b515f0763642ae57008c0
4
- data.tar.gz: eb7c95f1d00b9d2e1361fe1642a25bb51d9d42ab
3
+ metadata.gz: 729f56810aa501065e2fc203050363713c80ee37
4
+ data.tar.gz: e7e13fb75618f794a2c742d73d6c8a72699d5e92
5
5
  SHA512:
6
- metadata.gz: f734dca16f3a504caeb402b26f0b20c43c89d18e279facc58d0257500e4f8eb2ead727dca33947fd526e845a18950bf299f8351135281f63fe93fc1c96643047
7
- data.tar.gz: ee0ab1ef846235e499dc3a576ba8285c2e2e807d1c64612059e29d391418772d68cd0cc23474711015e29ec4c936d9f4305bb8a1c926dc5f53cd9d4ed0546896
6
+ metadata.gz: f87e76c751760b7f1feb7c859ea373c41ebf805c104c27e85177cb20a60d42b11c50db2d5a916fb7bfc78b82b13141770a851568aea922ccc1970f4e30ba1dea
7
+ data.tar.gz: ac4cb236c9c9897d73ead9421e161cf1c7aac2a3c1f77c088b5c52c324cddccda6ab749441093cbcc94ea812e70232f9f9ac1c160a96fd1fbd46d87586d1d7fb
@@ -1,16 +1,11 @@
1
- # 4.x (unreleased)
2
-
3
- ## Planned breaking changes:
4
- * `Redis#client` will no longer expose the underlying `Redis::Client`;
5
- it has not yet been determined how 4.0 will expose the underlying
6
- functionality, but we will make every attempt to provide a final minor
7
- release of 3.x that provides the new interfaces in order to facilitate
8
- a smooth transition.
9
-
10
- * Ruby 1.8.7 (and the 1.8 modes of JRuby and Rubinius) will no longer be
11
- supported; 1.8.x entered end-of-life in June of 2012 and stopped receiving
12
- security updates in June of 2013; continuing to support it would prevent
13
- the use of newer features of Ruby.
1
+ # 3.3.5
2
+
3
+ * Fixed Ruby 1.8 compatibility after backporting `Redis#connection`. See #719.
4
+
5
+ # 3.3.4
6
+
7
+ * `Redis#connection` returns a hash with connection information.
8
+ You shouldn't need to call `Redis#_client`, ever.
14
9
 
15
10
  # 3.3.3
16
11
 
@@ -2700,6 +2700,16 @@ class Redis
2700
2700
  self.class.new(@options)
2701
2701
  end
2702
2702
 
2703
+ def connection
2704
+ {
2705
+ :host => @original_client.host,
2706
+ :port => @original_client.port,
2707
+ :db => @original_client.db,
2708
+ :id => @original_client.id,
2709
+ :location => @original_client.location
2710
+ }
2711
+ end
2712
+
2703
2713
  def method_missing(command, *args)
2704
2714
  synchronize do |client|
2705
2715
  client.call([command] + args)
@@ -1,3 +1,3 @@
1
1
  class Redis
2
- VERSION = "3.3.3"
2
+ VERSION = "3.3.5"
3
3
  end
@@ -0,0 +1,57 @@
1
+ require_relative "helper"
2
+
3
+ class TestConnection < Test::Unit::TestCase
4
+
5
+ include Helper::Client
6
+
7
+ def test_provides_a_meaningful_inspect
8
+ assert_equal "#<Redis client v#{Redis::VERSION} for redis://127.0.0.1:#{PORT}/15>", r.inspect
9
+ end
10
+
11
+ def test_connection_information
12
+ assert_equal "127.0.0.1", r.connection.fetch(:host)
13
+ assert_equal 6381, r.connection.fetch(:port)
14
+ assert_equal 15, r.connection.fetch(:db)
15
+ assert_equal "127.0.0.1:6381", r.connection.fetch(:location)
16
+ assert_equal "redis://127.0.0.1:6381/15", r.connection.fetch(:id)
17
+ end
18
+
19
+ def test_default_id_with_host_and_port
20
+ redis = Redis.new(OPTIONS.merge(:host => "host", :port => "1234", :db => 0))
21
+ assert_equal "redis://host:1234/0", redis.connection.fetch(:id)
22
+ end
23
+
24
+ def test_default_id_with_host_and_port_and_explicit_scheme
25
+ redis = Redis.new(OPTIONS.merge(:host => "host", :port => "1234", :db => 0, :scheme => "foo"))
26
+ assert_equal "redis://host:1234/0", redis.connection.fetch(:id)
27
+ end
28
+
29
+ def test_default_id_with_path
30
+ redis = Redis.new(OPTIONS.merge(:path => "/tmp/redis.sock", :db => 0))
31
+ assert_equal "redis:///tmp/redis.sock/0", redis.connection.fetch(:id)
32
+ end
33
+
34
+ def test_default_id_with_path_and_explicit_scheme
35
+ redis = Redis.new(OPTIONS.merge(:path => "/tmp/redis.sock", :db => 0, :scheme => "foo"))
36
+ assert_equal "redis:///tmp/redis.sock/0", redis.connection.fetch(:id)
37
+ end
38
+
39
+ def test_override_id
40
+ redis = Redis.new(OPTIONS.merge(:id => "test"))
41
+ assert_equal "test", redis.connection.fetch(:id)
42
+ end
43
+
44
+ def test_id_inside_multi
45
+ redis = Redis.new(OPTIONS)
46
+ id = nil
47
+ connection_id = nil
48
+
49
+ redis.multi do
50
+ id = redis.id
51
+ connection_id = redis.connection.fetch(:id)
52
+ end
53
+
54
+ assert_equal "redis://127.0.0.1:6381/15", id
55
+ assert_equal "redis://127.0.0.1:6381/15", connection_id
56
+ end
57
+ end
@@ -44,10 +44,6 @@ class TestInternals < Test::Unit::TestCase
44
44
  end
45
45
  end
46
46
 
47
- def test_provides_a_meaningful_inspect
48
- assert_equal "#<Redis client v#{Redis::VERSION} for redis://127.0.0.1:#{PORT}/15>", r.inspect
49
- end
50
-
51
47
  def test_redis_current
52
48
  assert_equal "127.0.0.1", Redis.current.client.host
53
49
  assert_equal 6379, Redis.current.client.port
@@ -79,48 +75,12 @@ class TestInternals < Test::Unit::TestCase
79
75
  assert !fresh_client.connected?
80
76
  end
81
77
 
82
- def test_default_id_with_host_and_port
83
- redis = Redis.new(OPTIONS.merge(:host => "host", :port => "1234", :db => 0))
84
- assert_equal "redis://host:1234/0", redis.client.id
85
- end
86
-
87
- def test_default_id_with_host_and_port_and_explicit_scheme
88
- redis = Redis.new(OPTIONS.merge(:host => "host", :port => "1234", :db => 0, :scheme => "foo"))
89
- assert_equal "redis://host:1234/0", redis.client.id
90
- end
91
-
92
- def test_default_id_with_path
93
- redis = Redis.new(OPTIONS.merge(:path => "/tmp/redis.sock", :db => 0))
94
- assert_equal "redis:///tmp/redis.sock/0", redis.client.id
95
- end
96
-
97
- def test_default_id_with_path_and_explicit_scheme
98
- redis = Redis.new(OPTIONS.merge(:path => "/tmp/redis.sock", :db => 0, :scheme => "foo"))
99
- assert_equal "redis:///tmp/redis.sock/0", redis.client.id
100
- end
101
-
102
- def test_override_id
103
- redis = Redis.new(OPTIONS.merge(:id => "test"))
104
- assert_equal redis.client.id, "test"
105
- end
106
-
107
78
  def test_timeout
108
79
  assert_nothing_raised do
109
80
  Redis.new(OPTIONS.merge(:timeout => 0))
110
81
  end
111
82
  end
112
83
 
113
- def test_id_inside_multi
114
- redis = Redis.new(OPTIONS)
115
- id = nil
116
-
117
- redis.multi do
118
- id = redis.id
119
- end
120
-
121
- assert_equal id, "redis://127.0.0.1:6381/15"
122
- end
123
-
124
84
  driver(:ruby) do
125
85
  def test_tcp_keepalive
126
86
  keepalive = {:time => 20, :intvl => 10, :probes => 5}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.3
4
+ version: 3.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezra Zygmuntowicz
@@ -16,20 +16,20 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2017-01-23 00:00:00.000000000 Z
19
+ date: 2017-09-28 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rake
23
23
  requirement: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - <
25
+ - - "<"
26
26
  - !ruby/object:Gem::Version
27
27
  version: 11.0.0
28
28
  type: :development
29
29
  prerelease: false
30
30
  version_requirements: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - <
32
+ - - "<"
33
33
  - !ruby/object:Gem::Version
34
34
  version: 11.0.0
35
35
  - !ruby/object:Gem::Dependency
@@ -56,10 +56,10 @@ executables: []
56
56
  extensions: []
57
57
  extra_rdoc_files: []
58
58
  files:
59
- - .gitignore
60
- - .travis.yml
61
- - .travis/Gemfile
62
- - .yardopts
59
+ - ".gitignore"
60
+ - ".travis.yml"
61
+ - ".travis/Gemfile"
62
+ - ".yardopts"
63
63
  - CHANGELOG.md
64
64
  - Gemfile
65
65
  - LICENSE
@@ -109,6 +109,7 @@ files:
109
109
  - test/commands_on_strings_test.rb
110
110
  - test/commands_on_value_types_test.rb
111
111
  - test/connection_handling_test.rb
112
+ - test/connection_test.rb
112
113
  - test/db/.gitkeep
113
114
  - test/distributed_blocking_commands_test.rb
114
115
  - test/distributed_commands_on_hashes_test.rb
@@ -184,17 +185,17 @@ require_paths:
184
185
  - lib
185
186
  required_ruby_version: !ruby/object:Gem::Requirement
186
187
  requirements:
187
- - - '>='
188
+ - - ">="
188
189
  - !ruby/object:Gem::Version
189
190
  version: '0'
190
191
  required_rubygems_version: !ruby/object:Gem::Requirement
191
192
  requirements:
192
- - - '>='
193
+ - - ">="
193
194
  - !ruby/object:Gem::Version
194
195
  version: '0'
195
196
  requirements: []
196
197
  rubyforge_project:
197
- rubygems_version: 2.4.6
198
+ rubygems_version: 2.5.1
198
199
  signing_key:
199
200
  specification_version: 4
200
201
  summary: A Ruby client library for Redis
@@ -211,6 +212,7 @@ test_files:
211
212
  - test/commands_on_strings_test.rb
212
213
  - test/commands_on_value_types_test.rb
213
214
  - test/connection_handling_test.rb
215
+ - test/connection_test.rb
214
216
  - test/db/.gitkeep
215
217
  - test/distributed_blocking_commands_test.rb
216
218
  - test/distributed_commands_on_hashes_test.rb