redis 3.3.5 → 4.0.0
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 +4 -4
- data/.travis.yml +36 -52
- data/.travis/Gemfile +3 -1
- data/CHANGELOG.md +8 -6
- data/Gemfile +0 -1
- data/README.md +31 -75
- data/benchmarking/logging.rb +1 -1
- data/bors.toml +14 -0
- data/lib/redis.rb +68 -41
- data/lib/redis/client.rb +12 -8
- data/lib/redis/connection.rb +2 -2
- data/lib/redis/connection/command_helper.rb +2 -8
- data/lib/redis/connection/hiredis.rb +2 -2
- data/lib/redis/connection/ruby.rb +8 -28
- data/lib/redis/connection/synchrony.rb +12 -4
- data/lib/redis/distributed.rb +3 -3
- data/lib/redis/hash_ring.rb +20 -64
- data/lib/redis/pipeline.rb +0 -6
- data/lib/redis/version.rb +1 -1
- data/makefile +42 -0
- data/redis.gemspec +7 -9
- data/test/bitpos_test.rb +13 -19
- data/test/blocking_commands_test.rb +3 -5
- data/test/client_test.rb +1 -1
- data/test/command_map_test.rb +3 -5
- data/test/commands_on_hashes_test.rb +2 -4
- data/test/commands_on_hyper_log_log_test.rb +3 -5
- data/test/commands_on_lists_test.rb +2 -4
- data/test/commands_on_sets_test.rb +2 -4
- data/test/commands_on_sorted_sets_test.rb +17 -4
- data/test/commands_on_strings_test.rb +3 -5
- data/test/commands_on_value_types_test.rb +4 -6
- data/test/connection_handling_test.rb +5 -7
- data/test/distributed_blocking_commands_test.rb +2 -4
- data/test/distributed_commands_on_hashes_test.rb +2 -4
- data/test/distributed_commands_on_hyper_log_log_test.rb +2 -4
- data/test/distributed_commands_on_lists_test.rb +2 -4
- data/test/distributed_commands_on_sets_test.rb +2 -4
- data/test/distributed_commands_on_sorted_sets_test.rb +2 -4
- data/test/distributed_commands_on_strings_test.rb +2 -4
- data/test/distributed_commands_on_value_types_test.rb +2 -4
- data/test/distributed_commands_requiring_clustering_test.rb +1 -3
- data/test/distributed_connection_handling_test.rb +1 -3
- data/test/distributed_internals_test.rb +8 -19
- data/test/distributed_key_tags_test.rb +4 -6
- data/test/distributed_persistence_control_commands_test.rb +1 -3
- data/test/distributed_publish_subscribe_test.rb +1 -3
- data/test/distributed_remote_server_control_commands_test.rb +1 -3
- data/test/distributed_scripting_test.rb +1 -3
- data/test/distributed_sorting_test.rb +1 -3
- data/test/distributed_test.rb +12 -14
- data/test/distributed_transactions_test.rb +1 -3
- data/test/encoding_test.rb +4 -8
- data/test/error_replies_test.rb +2 -4
- data/test/fork_safety_test.rb +1 -6
- data/test/helper.rb +10 -41
- data/test/helper_test.rb +1 -3
- data/test/internals_test.rb +67 -55
- data/test/lint/strings.rb +6 -20
- data/test/lint/value_types.rb +8 -0
- data/test/persistence_control_commands_test.rb +1 -3
- data/test/pipelining_commands_test.rb +4 -8
- data/test/publish_subscribe_test.rb +1 -3
- data/test/remote_server_control_commands_test.rb +60 -3
- data/test/scanning_test.rb +1 -7
- data/test/scripting_test.rb +1 -3
- data/test/sentinel_command_test.rb +1 -3
- data/test/sentinel_test.rb +1 -3
- data/test/sorting_test.rb +1 -3
- data/test/ssl_test.rb +45 -49
- data/test/support/connection/hiredis.rb +1 -1
- data/test/support/connection/ruby.rb +1 -1
- data/test/support/connection/synchrony.rb +1 -1
- data/test/synchrony_driver.rb +6 -9
- data/test/thread_safety_test.rb +1 -3
- data/test/transactions_test.rb +1 -3
- data/test/unknown_commands_test.rb +1 -3
- data/test/url_param_test.rb +44 -46
- metadata +30 -18
- data/Rakefile +0 -87
- data/test/connection_test.rb +0 -57
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:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezra Zygmuntowicz
|
@@ -16,40 +16,53 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2017-
|
19
|
+
date: 2017-08-25 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
22
|
+
name: test-unit
|
23
23
|
requirement: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 3.1.5
|
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
|
-
version:
|
34
|
+
version: 3.1.5
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
36
|
+
name: hiredis
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: '0'
|
42
42
|
type: :development
|
43
43
|
prerelease: false
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: '0'
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: em-synchrony
|
51
|
+
requirement: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
49
63
|
description: |2
|
50
64
|
A Ruby client that tries to match Redis' API one-to-one, while still
|
51
|
-
providing an idiomatic interface.
|
52
|
-
client-side sharding, pipelining, and an obsession for performance.
|
65
|
+
providing an idiomatic interface.
|
53
66
|
email:
|
54
67
|
- redis-db@googlegroups.com
|
55
68
|
executables: []
|
@@ -64,12 +77,12 @@ files:
|
|
64
77
|
- Gemfile
|
65
78
|
- LICENSE
|
66
79
|
- README.md
|
67
|
-
- Rakefile
|
68
80
|
- benchmarking/logging.rb
|
69
81
|
- benchmarking/pipeline.rb
|
70
82
|
- benchmarking/speed.rb
|
71
83
|
- benchmarking/suite.rb
|
72
84
|
- benchmarking/worker.rb
|
85
|
+
- bors.toml
|
73
86
|
- examples/basic.rb
|
74
87
|
- examples/consistency.rb
|
75
88
|
- examples/dist_redis.rb
|
@@ -96,6 +109,7 @@ files:
|
|
96
109
|
- lib/redis/pipeline.rb
|
97
110
|
- lib/redis/subscribe.rb
|
98
111
|
- lib/redis/version.rb
|
112
|
+
- makefile
|
99
113
|
- redis.gemspec
|
100
114
|
- test/bitpos_test.rb
|
101
115
|
- test/blocking_commands_test.rb
|
@@ -109,7 +123,6 @@ files:
|
|
109
123
|
- test/commands_on_strings_test.rb
|
110
124
|
- test/commands_on_value_types_test.rb
|
111
125
|
- test/connection_handling_test.rb
|
112
|
-
- test/connection_test.rb
|
113
126
|
- test/db/.gitkeep
|
114
127
|
- test/distributed_blocking_commands_test.rb
|
115
128
|
- test/distributed_commands_on_hashes_test.rb
|
@@ -187,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
187
200
|
requirements:
|
188
201
|
- - ">="
|
189
202
|
- !ruby/object:Gem::Version
|
190
|
-
version:
|
203
|
+
version: 2.2.2
|
191
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
205
|
requirements:
|
193
206
|
- - ">="
|
@@ -212,7 +225,6 @@ test_files:
|
|
212
225
|
- test/commands_on_strings_test.rb
|
213
226
|
- test/commands_on_value_types_test.rb
|
214
227
|
- test/connection_handling_test.rb
|
215
|
-
- test/connection_test.rb
|
216
228
|
- test/db/.gitkeep
|
217
229
|
- test/distributed_blocking_commands_test.rb
|
218
230
|
- test/distributed_commands_on_hashes_test.rb
|
data/Rakefile
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
require "rake/testtask"
|
2
|
-
|
3
|
-
ENV["REDIS_BRANCH"] ||= "unstable"
|
4
|
-
|
5
|
-
REDIS_DIR = File.expand_path(File.join("..", "test"), __FILE__)
|
6
|
-
REDIS_CNF = File.join(REDIS_DIR, "test.conf")
|
7
|
-
REDIS_CNF_TEMPLATE = File.join(REDIS_DIR, "test.conf.erb")
|
8
|
-
REDIS_PID = File.join(REDIS_DIR, "db", "redis.pid")
|
9
|
-
REDIS_LOG = File.join(REDIS_DIR, "db", "redis.log")
|
10
|
-
REDIS_SOCKET = File.join(REDIS_DIR, "db", "redis.sock")
|
11
|
-
BINARY = "tmp/redis-#{ENV["REDIS_BRANCH"]}/src/redis-server"
|
12
|
-
|
13
|
-
task :default => :run
|
14
|
-
|
15
|
-
desc "Run tests and manage server start/stop"
|
16
|
-
task :run => [:start, :test, :stop]
|
17
|
-
|
18
|
-
desc "Start the Redis server"
|
19
|
-
task :start => [BINARY, REDIS_CNF] do
|
20
|
-
sh "#{BINARY} --version"
|
21
|
-
|
22
|
-
redis_running = \
|
23
|
-
begin
|
24
|
-
File.exists?(REDIS_PID) && Process.kill(0, File.read(REDIS_PID).to_i)
|
25
|
-
rescue Errno::ESRCH
|
26
|
-
FileUtils.rm REDIS_PID
|
27
|
-
false
|
28
|
-
end
|
29
|
-
|
30
|
-
unless redis_running
|
31
|
-
unless system("#{BINARY} #{REDIS_CNF}")
|
32
|
-
abort "could not start redis-server"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
at_exit do
|
37
|
-
Rake::Task["stop"].invoke
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
desc "Stop the Redis server"
|
42
|
-
task :stop do
|
43
|
-
if File.exists?(REDIS_PID)
|
44
|
-
Process.kill "INT", File.read(REDIS_PID).to_i
|
45
|
-
FileUtils.rm REDIS_PID
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
desc "Clean up testing artifacts"
|
50
|
-
task :clean do
|
51
|
-
FileUtils.rm_f(BINARY)
|
52
|
-
FileUtils.rm_f(REDIS_CNF)
|
53
|
-
end
|
54
|
-
|
55
|
-
file BINARY do
|
56
|
-
branch = ENV.fetch("REDIS_BRANCH")
|
57
|
-
|
58
|
-
sh <<-SH
|
59
|
-
mkdir -p tmp;
|
60
|
-
cd tmp;
|
61
|
-
rm -rf redis-#{branch};
|
62
|
-
wget https://github.com/antirez/redis/archive/#{branch}.tar.gz -O #{branch}.tar.gz;
|
63
|
-
tar xf #{branch}.tar.gz;
|
64
|
-
cd redis-#{branch};
|
65
|
-
make
|
66
|
-
SH
|
67
|
-
end
|
68
|
-
|
69
|
-
file REDIS_CNF => [REDIS_CNF_TEMPLATE, __FILE__] do |t|
|
70
|
-
require 'erb'
|
71
|
-
|
72
|
-
erb = t.prerequisites[0]
|
73
|
-
template = File.read(erb)
|
74
|
-
|
75
|
-
File.open(REDIS_CNF, 'w') do |file|
|
76
|
-
file.puts "\# This file was auto-generated at #{Time.now}",
|
77
|
-
"\# from (#{erb})",
|
78
|
-
"\#"
|
79
|
-
conf = ERB.new(template).result
|
80
|
-
file << conf
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
Rake::TestTask.new do |t|
|
85
|
-
t.options = "-v" if $VERBOSE
|
86
|
-
t.test_files = FileList["test/*_test.rb"]
|
87
|
-
end
|
data/test/connection_test.rb
DELETED
@@ -1,57 +0,0 @@
|
|
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
|