gorsuch-redis 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +10 -0
- data/.yardopts +3 -0
- data/CHANGELOG.md +113 -0
- data/LICENSE +20 -0
- data/README.md +214 -0
- data/Rakefile +260 -0
- data/TODO.md +4 -0
- data/benchmarking/logging.rb +62 -0
- data/benchmarking/pipeline.rb +51 -0
- data/benchmarking/speed.rb +21 -0
- data/benchmarking/suite.rb +24 -0
- data/benchmarking/thread_safety.rb +38 -0
- data/benchmarking/worker.rb +71 -0
- data/examples/basic.rb +15 -0
- data/examples/dist_redis.rb +43 -0
- data/examples/incr-decr.rb +17 -0
- data/examples/list.rb +26 -0
- data/examples/pubsub.rb +31 -0
- data/examples/sets.rb +36 -0
- data/examples/unicorn/config.ru +3 -0
- data/examples/unicorn/unicorn.rb +20 -0
- data/lib/redis/client.rb +303 -0
- data/lib/redis/connection/command_helper.rb +44 -0
- data/lib/redis/connection/hiredis.rb +52 -0
- data/lib/redis/connection/registry.rb +12 -0
- data/lib/redis/connection/ruby.rb +136 -0
- data/lib/redis/connection/synchrony.rb +131 -0
- data/lib/redis/connection.rb +9 -0
- data/lib/redis/distributed.rb +696 -0
- data/lib/redis/errors.rb +38 -0
- data/lib/redis/hash_ring.rb +131 -0
- data/lib/redis/pipeline.rb +106 -0
- data/lib/redis/subscribe.rb +79 -0
- data/lib/redis/version.rb +3 -0
- data/lib/redis.rb +1724 -0
- data/redis.gemspec +43 -0
- data/test/command_map_test.rb +29 -0
- data/test/commands_on_hashes_test.rb +20 -0
- data/test/commands_on_lists_test.rb +60 -0
- data/test/commands_on_sets_test.rb +76 -0
- data/test/commands_on_sorted_sets_test.rb +108 -0
- data/test/commands_on_strings_test.rb +80 -0
- data/test/commands_on_value_types_test.rb +87 -0
- data/test/connection_handling_test.rb +204 -0
- data/test/db/.gitignore +1 -0
- data/test/distributed_blocking_commands_test.rb +53 -0
- data/test/distributed_commands_on_hashes_test.rb +11 -0
- data/test/distributed_commands_on_lists_test.rb +23 -0
- data/test/distributed_commands_on_sets_test.rb +84 -0
- data/test/distributed_commands_on_sorted_sets_test.rb +19 -0
- data/test/distributed_commands_on_strings_test.rb +49 -0
- data/test/distributed_commands_on_value_types_test.rb +72 -0
- data/test/distributed_commands_requiring_clustering_test.rb +148 -0
- data/test/distributed_connection_handling_test.rb +24 -0
- data/test/distributed_internals_test.rb +27 -0
- data/test/distributed_key_tags_test.rb +52 -0
- data/test/distributed_persistence_control_commands_test.rb +23 -0
- data/test/distributed_publish_subscribe_test.rb +100 -0
- data/test/distributed_remote_server_control_commands_test.rb +42 -0
- data/test/distributed_sorting_test.rb +21 -0
- data/test/distributed_test.rb +59 -0
- data/test/distributed_transactions_test.rb +33 -0
- data/test/encoding_test.rb +15 -0
- data/test/error_replies_test.rb +53 -0
- data/test/helper.rb +155 -0
- data/test/helper_test.rb +8 -0
- data/test/internals_test.rb +152 -0
- data/test/lint/hashes.rb +140 -0
- data/test/lint/internals.rb +36 -0
- data/test/lint/lists.rb +107 -0
- data/test/lint/sets.rb +90 -0
- data/test/lint/sorted_sets.rb +196 -0
- data/test/lint/strings.rb +133 -0
- data/test/lint/value_types.rb +81 -0
- data/test/persistence_control_commands_test.rb +21 -0
- data/test/pipelining_commands_test.rb +186 -0
- data/test/publish_subscribe_test.rb +158 -0
- data/test/redis_mock.rb +89 -0
- data/test/remote_server_control_commands_test.rb +88 -0
- data/test/sorting_test.rb +43 -0
- data/test/synchrony_driver.rb +57 -0
- data/test/test.conf +9 -0
- data/test/thread_safety_test.rb +30 -0
- data/test/transactions_test.rb +173 -0
- data/test/unknown_commands_test.rb +13 -0
- data/test/url_param_test.rb +59 -0
- metadata +236 -0
@@ -0,0 +1,59 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require File.expand_path("./helper", File.dirname(__FILE__))
|
4
|
+
|
5
|
+
test "URL defaults to 127.0.0.1:6379" do
|
6
|
+
redis = Redis.connect
|
7
|
+
|
8
|
+
assert "127.0.0.1" == redis.client.host
|
9
|
+
assert 6379 == redis.client.port
|
10
|
+
assert 0 == redis.client.db
|
11
|
+
assert nil == redis.client.password
|
12
|
+
end
|
13
|
+
|
14
|
+
test "allows to pass in a URL" do
|
15
|
+
redis = Redis.connect :url => "redis://:secr3t@foo.com:999/2"
|
16
|
+
|
17
|
+
assert "foo.com" == redis.client.host
|
18
|
+
assert 999 == redis.client.port
|
19
|
+
assert 2 == redis.client.db
|
20
|
+
assert "secr3t" == redis.client.password
|
21
|
+
end
|
22
|
+
|
23
|
+
test "override URL if path option is passed" do
|
24
|
+
redis = Redis.connect :url => "redis://:secr3t@foo.com/foo:999/2", :path => "/tmp/redis.sock"
|
25
|
+
|
26
|
+
assert "/tmp/redis.sock" == redis.client.path
|
27
|
+
assert nil == redis.client.host
|
28
|
+
assert nil == redis.client.port
|
29
|
+
end
|
30
|
+
|
31
|
+
test "overrides URL if another connection option is passed" do
|
32
|
+
redis = Redis.connect :url => "redis://:secr3t@foo.com:999/2", :port => 1000
|
33
|
+
|
34
|
+
assert "foo.com" == redis.client.host
|
35
|
+
assert 1000 == redis.client.port
|
36
|
+
assert 2 == redis.client.db
|
37
|
+
assert "secr3t" == redis.client.password
|
38
|
+
end
|
39
|
+
|
40
|
+
test "does not modify the passed options" do
|
41
|
+
options = { :url => "redis://:secr3t@foo.com:999/2" }
|
42
|
+
|
43
|
+
redis = Redis.connect(options)
|
44
|
+
|
45
|
+
assert({ :url => "redis://:secr3t@foo.com:999/2" } == options)
|
46
|
+
end
|
47
|
+
|
48
|
+
test "uses REDIS_URL over default if available" do
|
49
|
+
ENV["REDIS_URL"] = "redis://:secr3t@foo.com:999/2"
|
50
|
+
|
51
|
+
redis = Redis.connect
|
52
|
+
|
53
|
+
assert "foo.com" == redis.client.host
|
54
|
+
assert 999 == redis.client.port
|
55
|
+
assert 2 == redis.client.db
|
56
|
+
assert "secr3t" == redis.client.password
|
57
|
+
|
58
|
+
ENV.delete("REDIS_URL")
|
59
|
+
end
|
metadata
ADDED
@@ -0,0 +1,236 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gorsuch-redis
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.0.rc1
|
5
|
+
prerelease: 6
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Ezra Zygmuntowicz
|
9
|
+
- Taylor Weibley
|
10
|
+
- Matthew Clark
|
11
|
+
- Brian McKinney
|
12
|
+
- Salvatore Sanfilippo
|
13
|
+
- Luca Guidi
|
14
|
+
- Michel Martens
|
15
|
+
- Damian Janowski
|
16
|
+
- Pieter Noordhuis
|
17
|
+
autorequire:
|
18
|
+
bindir: bin
|
19
|
+
cert_chain: []
|
20
|
+
date: 2012-04-03 00:00:00.000000000 Z
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
23
|
+
name: rake
|
24
|
+
requirement: &70190528581140 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
type: :development
|
31
|
+
prerelease: false
|
32
|
+
version_requirements: *70190528581140
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: cutest
|
35
|
+
requirement: &70190528594160 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
type: :development
|
42
|
+
prerelease: false
|
43
|
+
version_requirements: *70190528594160
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: hiredis
|
46
|
+
requirement: &70190528592840 !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
48
|
+
requirements:
|
49
|
+
- - ! '>='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
type: :development
|
53
|
+
prerelease: false
|
54
|
+
version_requirements: *70190528592840
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: em-synchrony
|
57
|
+
requirement: &70190528590400 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: *70190528590400
|
66
|
+
description: ! " A simple Ruby client trying to match Redis' API one-to-one while
|
67
|
+
still providing a Rubystic interface.\n It features thread safety, client-side
|
68
|
+
sharding, and an obsession for performance.\n"
|
69
|
+
email:
|
70
|
+
- redis-db@googlegroups.com
|
71
|
+
executables: []
|
72
|
+
extensions: []
|
73
|
+
extra_rdoc_files: []
|
74
|
+
files:
|
75
|
+
- .gitignore
|
76
|
+
- .yardopts
|
77
|
+
- CHANGELOG.md
|
78
|
+
- LICENSE
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
81
|
+
- TODO.md
|
82
|
+
- benchmarking/logging.rb
|
83
|
+
- benchmarking/pipeline.rb
|
84
|
+
- benchmarking/speed.rb
|
85
|
+
- benchmarking/suite.rb
|
86
|
+
- benchmarking/thread_safety.rb
|
87
|
+
- benchmarking/worker.rb
|
88
|
+
- examples/basic.rb
|
89
|
+
- examples/dist_redis.rb
|
90
|
+
- examples/incr-decr.rb
|
91
|
+
- examples/list.rb
|
92
|
+
- examples/pubsub.rb
|
93
|
+
- examples/sets.rb
|
94
|
+
- examples/unicorn/config.ru
|
95
|
+
- examples/unicorn/unicorn.rb
|
96
|
+
- lib/redis.rb
|
97
|
+
- lib/redis/client.rb
|
98
|
+
- lib/redis/connection.rb
|
99
|
+
- lib/redis/connection/command_helper.rb
|
100
|
+
- lib/redis/connection/hiredis.rb
|
101
|
+
- lib/redis/connection/registry.rb
|
102
|
+
- lib/redis/connection/ruby.rb
|
103
|
+
- lib/redis/connection/synchrony.rb
|
104
|
+
- lib/redis/distributed.rb
|
105
|
+
- lib/redis/errors.rb
|
106
|
+
- lib/redis/hash_ring.rb
|
107
|
+
- lib/redis/pipeline.rb
|
108
|
+
- lib/redis/subscribe.rb
|
109
|
+
- lib/redis/version.rb
|
110
|
+
- redis.gemspec
|
111
|
+
- test/command_map_test.rb
|
112
|
+
- test/commands_on_hashes_test.rb
|
113
|
+
- test/commands_on_lists_test.rb
|
114
|
+
- test/commands_on_sets_test.rb
|
115
|
+
- test/commands_on_sorted_sets_test.rb
|
116
|
+
- test/commands_on_strings_test.rb
|
117
|
+
- test/commands_on_value_types_test.rb
|
118
|
+
- test/connection_handling_test.rb
|
119
|
+
- test/db/.gitignore
|
120
|
+
- test/distributed_blocking_commands_test.rb
|
121
|
+
- test/distributed_commands_on_hashes_test.rb
|
122
|
+
- test/distributed_commands_on_lists_test.rb
|
123
|
+
- test/distributed_commands_on_sets_test.rb
|
124
|
+
- test/distributed_commands_on_sorted_sets_test.rb
|
125
|
+
- test/distributed_commands_on_strings_test.rb
|
126
|
+
- test/distributed_commands_on_value_types_test.rb
|
127
|
+
- test/distributed_commands_requiring_clustering_test.rb
|
128
|
+
- test/distributed_connection_handling_test.rb
|
129
|
+
- test/distributed_internals_test.rb
|
130
|
+
- test/distributed_key_tags_test.rb
|
131
|
+
- test/distributed_persistence_control_commands_test.rb
|
132
|
+
- test/distributed_publish_subscribe_test.rb
|
133
|
+
- test/distributed_remote_server_control_commands_test.rb
|
134
|
+
- test/distributed_sorting_test.rb
|
135
|
+
- test/distributed_test.rb
|
136
|
+
- test/distributed_transactions_test.rb
|
137
|
+
- test/encoding_test.rb
|
138
|
+
- test/error_replies_test.rb
|
139
|
+
- test/helper.rb
|
140
|
+
- test/helper_test.rb
|
141
|
+
- test/internals_test.rb
|
142
|
+
- test/lint/hashes.rb
|
143
|
+
- test/lint/internals.rb
|
144
|
+
- test/lint/lists.rb
|
145
|
+
- test/lint/sets.rb
|
146
|
+
- test/lint/sorted_sets.rb
|
147
|
+
- test/lint/strings.rb
|
148
|
+
- test/lint/value_types.rb
|
149
|
+
- test/persistence_control_commands_test.rb
|
150
|
+
- test/pipelining_commands_test.rb
|
151
|
+
- test/publish_subscribe_test.rb
|
152
|
+
- test/redis_mock.rb
|
153
|
+
- test/remote_server_control_commands_test.rb
|
154
|
+
- test/sorting_test.rb
|
155
|
+
- test/synchrony_driver.rb
|
156
|
+
- test/test.conf
|
157
|
+
- test/thread_safety_test.rb
|
158
|
+
- test/transactions_test.rb
|
159
|
+
- test/unknown_commands_test.rb
|
160
|
+
- test/url_param_test.rb
|
161
|
+
homepage: https://github.com/ezmobius/redis-rb
|
162
|
+
licenses: []
|
163
|
+
post_install_message:
|
164
|
+
rdoc_options: []
|
165
|
+
require_paths:
|
166
|
+
- lib
|
167
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
168
|
+
none: false
|
169
|
+
requirements:
|
170
|
+
- - ! '>='
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
|
+
none: false
|
175
|
+
requirements:
|
176
|
+
- - ! '>'
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: 1.3.1
|
179
|
+
requirements: []
|
180
|
+
rubyforge_project:
|
181
|
+
rubygems_version: 1.8.10
|
182
|
+
signing_key:
|
183
|
+
specification_version: 3
|
184
|
+
summary: A Ruby client library for the Redis key-value store.
|
185
|
+
test_files:
|
186
|
+
- test/command_map_test.rb
|
187
|
+
- test/commands_on_hashes_test.rb
|
188
|
+
- test/commands_on_lists_test.rb
|
189
|
+
- test/commands_on_sets_test.rb
|
190
|
+
- test/commands_on_sorted_sets_test.rb
|
191
|
+
- test/commands_on_strings_test.rb
|
192
|
+
- test/commands_on_value_types_test.rb
|
193
|
+
- test/connection_handling_test.rb
|
194
|
+
- test/db/.gitignore
|
195
|
+
- test/distributed_blocking_commands_test.rb
|
196
|
+
- test/distributed_commands_on_hashes_test.rb
|
197
|
+
- test/distributed_commands_on_lists_test.rb
|
198
|
+
- test/distributed_commands_on_sets_test.rb
|
199
|
+
- test/distributed_commands_on_sorted_sets_test.rb
|
200
|
+
- test/distributed_commands_on_strings_test.rb
|
201
|
+
- test/distributed_commands_on_value_types_test.rb
|
202
|
+
- test/distributed_commands_requiring_clustering_test.rb
|
203
|
+
- test/distributed_connection_handling_test.rb
|
204
|
+
- test/distributed_internals_test.rb
|
205
|
+
- test/distributed_key_tags_test.rb
|
206
|
+
- test/distributed_persistence_control_commands_test.rb
|
207
|
+
- test/distributed_publish_subscribe_test.rb
|
208
|
+
- test/distributed_remote_server_control_commands_test.rb
|
209
|
+
- test/distributed_sorting_test.rb
|
210
|
+
- test/distributed_test.rb
|
211
|
+
- test/distributed_transactions_test.rb
|
212
|
+
- test/encoding_test.rb
|
213
|
+
- test/error_replies_test.rb
|
214
|
+
- test/helper.rb
|
215
|
+
- test/helper_test.rb
|
216
|
+
- test/internals_test.rb
|
217
|
+
- test/lint/hashes.rb
|
218
|
+
- test/lint/internals.rb
|
219
|
+
- test/lint/lists.rb
|
220
|
+
- test/lint/sets.rb
|
221
|
+
- test/lint/sorted_sets.rb
|
222
|
+
- test/lint/strings.rb
|
223
|
+
- test/lint/value_types.rb
|
224
|
+
- test/persistence_control_commands_test.rb
|
225
|
+
- test/pipelining_commands_test.rb
|
226
|
+
- test/publish_subscribe_test.rb
|
227
|
+
- test/redis_mock.rb
|
228
|
+
- test/remote_server_control_commands_test.rb
|
229
|
+
- test/sorting_test.rb
|
230
|
+
- test/synchrony_driver.rb
|
231
|
+
- test/test.conf
|
232
|
+
- test/thread_safety_test.rb
|
233
|
+
- test/transactions_test.rb
|
234
|
+
- test/unknown_commands_test.rb
|
235
|
+
- test/url_param_test.rb
|
236
|
+
has_rdoc:
|