redis 3.3.5 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -2
  3. data/README.md +77 -76
  4. data/lib/redis.rb +779 -63
  5. data/lib/redis/client.rb +41 -20
  6. data/lib/redis/cluster.rb +286 -0
  7. data/lib/redis/cluster/command.rb +81 -0
  8. data/lib/redis/cluster/command_loader.rb +34 -0
  9. data/lib/redis/cluster/key_slot_converter.rb +72 -0
  10. data/lib/redis/cluster/node.rb +104 -0
  11. data/lib/redis/cluster/node_key.rb +35 -0
  12. data/lib/redis/cluster/node_loader.rb +37 -0
  13. data/lib/redis/cluster/option.rb +77 -0
  14. data/lib/redis/cluster/slot.rb +69 -0
  15. data/lib/redis/cluster/slot_loader.rb +49 -0
  16. data/lib/redis/connection.rb +2 -2
  17. data/lib/redis/connection/command_helper.rb +2 -8
  18. data/lib/redis/connection/hiredis.rb +2 -2
  19. data/lib/redis/connection/ruby.rb +13 -30
  20. data/lib/redis/connection/synchrony.rb +12 -4
  21. data/lib/redis/distributed.rb +32 -12
  22. data/lib/redis/errors.rb +46 -0
  23. data/lib/redis/hash_ring.rb +20 -64
  24. data/lib/redis/pipeline.rb +9 -7
  25. data/lib/redis/version.rb +1 -1
  26. metadata +53 -196
  27. data/.gitignore +0 -16
  28. data/.travis.yml +0 -89
  29. data/.travis/Gemfile +0 -11
  30. data/.yardopts +0 -3
  31. data/Gemfile +0 -4
  32. data/Rakefile +0 -87
  33. data/benchmarking/logging.rb +0 -71
  34. data/benchmarking/pipeline.rb +0 -51
  35. data/benchmarking/speed.rb +0 -21
  36. data/benchmarking/suite.rb +0 -24
  37. data/benchmarking/worker.rb +0 -71
  38. data/examples/basic.rb +0 -15
  39. data/examples/consistency.rb +0 -114
  40. data/examples/dist_redis.rb +0 -43
  41. data/examples/incr-decr.rb +0 -17
  42. data/examples/list.rb +0 -26
  43. data/examples/pubsub.rb +0 -37
  44. data/examples/sentinel.rb +0 -41
  45. data/examples/sentinel/start +0 -49
  46. data/examples/sets.rb +0 -36
  47. data/examples/unicorn/config.ru +0 -3
  48. data/examples/unicorn/unicorn.rb +0 -20
  49. data/redis.gemspec +0 -44
  50. data/test/bitpos_test.rb +0 -69
  51. data/test/blocking_commands_test.rb +0 -42
  52. data/test/client_test.rb +0 -59
  53. data/test/command_map_test.rb +0 -30
  54. data/test/commands_on_hashes_test.rb +0 -21
  55. data/test/commands_on_hyper_log_log_test.rb +0 -21
  56. data/test/commands_on_lists_test.rb +0 -20
  57. data/test/commands_on_sets_test.rb +0 -77
  58. data/test/commands_on_sorted_sets_test.rb +0 -137
  59. data/test/commands_on_strings_test.rb +0 -101
  60. data/test/commands_on_value_types_test.rb +0 -133
  61. data/test/connection_handling_test.rb +0 -277
  62. data/test/connection_test.rb +0 -57
  63. data/test/distributed_blocking_commands_test.rb +0 -46
  64. data/test/distributed_commands_on_hashes_test.rb +0 -10
  65. data/test/distributed_commands_on_hyper_log_log_test.rb +0 -33
  66. data/test/distributed_commands_on_lists_test.rb +0 -22
  67. data/test/distributed_commands_on_sets_test.rb +0 -83
  68. data/test/distributed_commands_on_sorted_sets_test.rb +0 -18
  69. data/test/distributed_commands_on_strings_test.rb +0 -59
  70. data/test/distributed_commands_on_value_types_test.rb +0 -95
  71. data/test/distributed_commands_requiring_clustering_test.rb +0 -164
  72. data/test/distributed_connection_handling_test.rb +0 -23
  73. data/test/distributed_internals_test.rb +0 -79
  74. data/test/distributed_key_tags_test.rb +0 -52
  75. data/test/distributed_persistence_control_commands_test.rb +0 -26
  76. data/test/distributed_publish_subscribe_test.rb +0 -92
  77. data/test/distributed_remote_server_control_commands_test.rb +0 -66
  78. data/test/distributed_scripting_test.rb +0 -102
  79. data/test/distributed_sorting_test.rb +0 -20
  80. data/test/distributed_test.rb +0 -58
  81. data/test/distributed_transactions_test.rb +0 -32
  82. data/test/encoding_test.rb +0 -18
  83. data/test/error_replies_test.rb +0 -59
  84. data/test/fork_safety_test.rb +0 -65
  85. data/test/helper.rb +0 -232
  86. data/test/helper_test.rb +0 -24
  87. data/test/internals_test.rb +0 -417
  88. data/test/lint/blocking_commands.rb +0 -150
  89. data/test/lint/hashes.rb +0 -162
  90. data/test/lint/hyper_log_log.rb +0 -60
  91. data/test/lint/lists.rb +0 -143
  92. data/test/lint/sets.rb +0 -140
  93. data/test/lint/sorted_sets.rb +0 -316
  94. data/test/lint/strings.rb +0 -260
  95. data/test/lint/value_types.rb +0 -122
  96. data/test/persistence_control_commands_test.rb +0 -26
  97. data/test/pipelining_commands_test.rb +0 -242
  98. data/test/publish_subscribe_test.rb +0 -282
  99. data/test/remote_server_control_commands_test.rb +0 -118
  100. data/test/scanning_test.rb +0 -413
  101. data/test/scripting_test.rb +0 -78
  102. data/test/sentinel_command_test.rb +0 -80
  103. data/test/sentinel_test.rb +0 -255
  104. data/test/sorting_test.rb +0 -59
  105. data/test/ssl_test.rb +0 -73
  106. data/test/support/connection/hiredis.rb +0 -1
  107. data/test/support/connection/ruby.rb +0 -1
  108. data/test/support/connection/synchrony.rb +0 -17
  109. data/test/support/redis_mock.rb +0 -130
  110. data/test/support/ssl/gen_certs.sh +0 -31
  111. data/test/support/ssl/trusted-ca.crt +0 -25
  112. data/test/support/ssl/trusted-ca.key +0 -27
  113. data/test/support/ssl/trusted-cert.crt +0 -81
  114. data/test/support/ssl/trusted-cert.key +0 -28
  115. data/test/support/ssl/untrusted-ca.crt +0 -26
  116. data/test/support/ssl/untrusted-ca.key +0 -27
  117. data/test/support/ssl/untrusted-cert.crt +0 -82
  118. data/test/support/ssl/untrusted-cert.key +0 -28
  119. data/test/support/wire/synchrony.rb +0 -24
  120. data/test/support/wire/thread.rb +0 -5
  121. data/test/synchrony_driver.rb +0 -88
  122. data/test/test.conf.erb +0 -9
  123. data/test/thread_safety_test.rb +0 -62
  124. data/test/transactions_test.rb +0 -264
  125. data/test/unknown_commands_test.rb +0 -14
  126. data/test/url_param_test.rb +0 -138
@@ -1,3 +1,3 @@
1
1
  class Redis
2
- VERSION = "3.3.5"
2
+ VERSION = '4.1.0'
3
3
  end
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.5
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezra Zygmuntowicz
@@ -16,74 +16,88 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2017-09-28 00:00:00.000000000 Z
19
+ date: 2018-12-13 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: rake
22
+ name: test-unit
23
23
  requirement: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "<"
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 11.0.0
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: 11.0.0
34
+ version: 3.1.5
35
35
  - !ruby/object:Gem::Dependency
36
- name: test-unit
36
+ name: mocha
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: 3.1.5
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: 3.1.5
48
+ version: '0'
49
+ - !ruby/object:Gem::Dependency
50
+ name: hiredis
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'
63
+ - !ruby/object:Gem::Dependency
64
+ name: em-synchrony
65
+ requirement: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
49
77
  description: |2
50
78
  A Ruby client that tries to match Redis' API one-to-one, while still
51
- providing an idiomatic interface. It features thread-safety,
52
- client-side sharding, pipelining, and an obsession for performance.
79
+ providing an idiomatic interface.
53
80
  email:
54
81
  - redis-db@googlegroups.com
55
82
  executables: []
56
83
  extensions: []
57
84
  extra_rdoc_files: []
58
85
  files:
59
- - ".gitignore"
60
- - ".travis.yml"
61
- - ".travis/Gemfile"
62
- - ".yardopts"
63
86
  - CHANGELOG.md
64
- - Gemfile
65
87
  - LICENSE
66
88
  - README.md
67
- - Rakefile
68
- - benchmarking/logging.rb
69
- - benchmarking/pipeline.rb
70
- - benchmarking/speed.rb
71
- - benchmarking/suite.rb
72
- - benchmarking/worker.rb
73
- - examples/basic.rb
74
- - examples/consistency.rb
75
- - examples/dist_redis.rb
76
- - examples/incr-decr.rb
77
- - examples/list.rb
78
- - examples/pubsub.rb
79
- - examples/sentinel.rb
80
- - examples/sentinel/sentinel.conf
81
- - examples/sentinel/start
82
- - examples/sets.rb
83
- - examples/unicorn/config.ru
84
- - examples/unicorn/unicorn.rb
85
89
  - lib/redis.rb
86
90
  - lib/redis/client.rb
91
+ - lib/redis/cluster.rb
92
+ - lib/redis/cluster/command.rb
93
+ - lib/redis/cluster/command_loader.rb
94
+ - lib/redis/cluster/key_slot_converter.rb
95
+ - lib/redis/cluster/node.rb
96
+ - lib/redis/cluster/node_key.rb
97
+ - lib/redis/cluster/node_loader.rb
98
+ - lib/redis/cluster/option.rb
99
+ - lib/redis/cluster/slot.rb
100
+ - lib/redis/cluster/slot_loader.rb
87
101
  - lib/redis/connection.rb
88
102
  - lib/redis/connection/command_helper.rb
89
103
  - lib/redis/connection/hiredis.rb
@@ -96,85 +110,6 @@ files:
96
110
  - lib/redis/pipeline.rb
97
111
  - lib/redis/subscribe.rb
98
112
  - lib/redis/version.rb
99
- - redis.gemspec
100
- - test/bitpos_test.rb
101
- - test/blocking_commands_test.rb
102
- - test/client_test.rb
103
- - test/command_map_test.rb
104
- - test/commands_on_hashes_test.rb
105
- - test/commands_on_hyper_log_log_test.rb
106
- - test/commands_on_lists_test.rb
107
- - test/commands_on_sets_test.rb
108
- - test/commands_on_sorted_sets_test.rb
109
- - test/commands_on_strings_test.rb
110
- - test/commands_on_value_types_test.rb
111
- - test/connection_handling_test.rb
112
- - test/connection_test.rb
113
- - test/db/.gitkeep
114
- - test/distributed_blocking_commands_test.rb
115
- - test/distributed_commands_on_hashes_test.rb
116
- - test/distributed_commands_on_hyper_log_log_test.rb
117
- - test/distributed_commands_on_lists_test.rb
118
- - test/distributed_commands_on_sets_test.rb
119
- - test/distributed_commands_on_sorted_sets_test.rb
120
- - test/distributed_commands_on_strings_test.rb
121
- - test/distributed_commands_on_value_types_test.rb
122
- - test/distributed_commands_requiring_clustering_test.rb
123
- - test/distributed_connection_handling_test.rb
124
- - test/distributed_internals_test.rb
125
- - test/distributed_key_tags_test.rb
126
- - test/distributed_persistence_control_commands_test.rb
127
- - test/distributed_publish_subscribe_test.rb
128
- - test/distributed_remote_server_control_commands_test.rb
129
- - test/distributed_scripting_test.rb
130
- - test/distributed_sorting_test.rb
131
- - test/distributed_test.rb
132
- - test/distributed_transactions_test.rb
133
- - test/encoding_test.rb
134
- - test/error_replies_test.rb
135
- - test/fork_safety_test.rb
136
- - test/helper.rb
137
- - test/helper_test.rb
138
- - test/internals_test.rb
139
- - test/lint/blocking_commands.rb
140
- - test/lint/hashes.rb
141
- - test/lint/hyper_log_log.rb
142
- - test/lint/lists.rb
143
- - test/lint/sets.rb
144
- - test/lint/sorted_sets.rb
145
- - test/lint/strings.rb
146
- - test/lint/value_types.rb
147
- - test/persistence_control_commands_test.rb
148
- - test/pipelining_commands_test.rb
149
- - test/publish_subscribe_test.rb
150
- - test/remote_server_control_commands_test.rb
151
- - test/scanning_test.rb
152
- - test/scripting_test.rb
153
- - test/sentinel_command_test.rb
154
- - test/sentinel_test.rb
155
- - test/sorting_test.rb
156
- - test/ssl_test.rb
157
- - test/support/connection/hiredis.rb
158
- - test/support/connection/ruby.rb
159
- - test/support/connection/synchrony.rb
160
- - test/support/redis_mock.rb
161
- - test/support/ssl/gen_certs.sh
162
- - test/support/ssl/trusted-ca.crt
163
- - test/support/ssl/trusted-ca.key
164
- - test/support/ssl/trusted-cert.crt
165
- - test/support/ssl/trusted-cert.key
166
- - test/support/ssl/untrusted-ca.crt
167
- - test/support/ssl/untrusted-ca.key
168
- - test/support/ssl/untrusted-cert.crt
169
- - test/support/ssl/untrusted-cert.key
170
- - test/support/wire/synchrony.rb
171
- - test/support/wire/thread.rb
172
- - test/synchrony_driver.rb
173
- - test/test.conf.erb
174
- - test/thread_safety_test.rb
175
- - test/transactions_test.rb
176
- - test/unknown_commands_test.rb
177
- - test/url_param_test.rb
178
113
  homepage: https://github.com/redis/redis-rb
179
114
  licenses:
180
115
  - MIT
@@ -187,7 +122,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
187
122
  requirements:
188
123
  - - ">="
189
124
  - !ruby/object:Gem::Version
190
- version: '0'
125
+ version: 2.2.2
191
126
  required_rubygems_version: !ruby/object:Gem::Requirement
192
127
  requirements:
193
128
  - - ">="
@@ -199,82 +134,4 @@ rubygems_version: 2.5.1
199
134
  signing_key:
200
135
  specification_version: 4
201
136
  summary: A Ruby client library for Redis
202
- test_files:
203
- - test/bitpos_test.rb
204
- - test/blocking_commands_test.rb
205
- - test/client_test.rb
206
- - test/command_map_test.rb
207
- - test/commands_on_hashes_test.rb
208
- - test/commands_on_hyper_log_log_test.rb
209
- - test/commands_on_lists_test.rb
210
- - test/commands_on_sets_test.rb
211
- - test/commands_on_sorted_sets_test.rb
212
- - test/commands_on_strings_test.rb
213
- - test/commands_on_value_types_test.rb
214
- - test/connection_handling_test.rb
215
- - test/connection_test.rb
216
- - test/db/.gitkeep
217
- - test/distributed_blocking_commands_test.rb
218
- - test/distributed_commands_on_hashes_test.rb
219
- - test/distributed_commands_on_hyper_log_log_test.rb
220
- - test/distributed_commands_on_lists_test.rb
221
- - test/distributed_commands_on_sets_test.rb
222
- - test/distributed_commands_on_sorted_sets_test.rb
223
- - test/distributed_commands_on_strings_test.rb
224
- - test/distributed_commands_on_value_types_test.rb
225
- - test/distributed_commands_requiring_clustering_test.rb
226
- - test/distributed_connection_handling_test.rb
227
- - test/distributed_internals_test.rb
228
- - test/distributed_key_tags_test.rb
229
- - test/distributed_persistence_control_commands_test.rb
230
- - test/distributed_publish_subscribe_test.rb
231
- - test/distributed_remote_server_control_commands_test.rb
232
- - test/distributed_scripting_test.rb
233
- - test/distributed_sorting_test.rb
234
- - test/distributed_test.rb
235
- - test/distributed_transactions_test.rb
236
- - test/encoding_test.rb
237
- - test/error_replies_test.rb
238
- - test/fork_safety_test.rb
239
- - test/helper.rb
240
- - test/helper_test.rb
241
- - test/internals_test.rb
242
- - test/lint/blocking_commands.rb
243
- - test/lint/hashes.rb
244
- - test/lint/hyper_log_log.rb
245
- - test/lint/lists.rb
246
- - test/lint/sets.rb
247
- - test/lint/sorted_sets.rb
248
- - test/lint/strings.rb
249
- - test/lint/value_types.rb
250
- - test/persistence_control_commands_test.rb
251
- - test/pipelining_commands_test.rb
252
- - test/publish_subscribe_test.rb
253
- - test/remote_server_control_commands_test.rb
254
- - test/scanning_test.rb
255
- - test/scripting_test.rb
256
- - test/sentinel_command_test.rb
257
- - test/sentinel_test.rb
258
- - test/sorting_test.rb
259
- - test/ssl_test.rb
260
- - test/support/connection/hiredis.rb
261
- - test/support/connection/ruby.rb
262
- - test/support/connection/synchrony.rb
263
- - test/support/redis_mock.rb
264
- - test/support/ssl/gen_certs.sh
265
- - test/support/ssl/trusted-ca.crt
266
- - test/support/ssl/trusted-ca.key
267
- - test/support/ssl/trusted-cert.crt
268
- - test/support/ssl/trusted-cert.key
269
- - test/support/ssl/untrusted-ca.crt
270
- - test/support/ssl/untrusted-ca.key
271
- - test/support/ssl/untrusted-cert.crt
272
- - test/support/ssl/untrusted-cert.key
273
- - test/support/wire/synchrony.rb
274
- - test/support/wire/thread.rb
275
- - test/synchrony_driver.rb
276
- - test/test.conf.erb
277
- - test/thread_safety_test.rb
278
- - test/transactions_test.rb
279
- - test/unknown_commands_test.rb
280
- - test/url_param_test.rb
137
+ test_files: []
data/.gitignore DELETED
@@ -1,16 +0,0 @@
1
- *.rdb
2
- *.swp
3
- Gemfile.lock
4
- *.gem
5
- /tmp/
6
- /.idea
7
- /.yardoc
8
- /coverage/*
9
- /doc/
10
- /examples/sentinel/sentinel.conf
11
- /nohup.out
12
- /pkg/*
13
- /rdsrv
14
- /redis/*
15
- /test/db
16
- /test/test.conf
@@ -1,89 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - 1.8.7
5
- - 1.9.3
6
- - 2.0
7
- - 2.1
8
- - 2.2
9
- - 2.3.0
10
- - jruby-18mode
11
- - jruby-19mode
12
- - jruby-9.0.5.0
13
- - rbx-2
14
-
15
- gemfile: ".travis/Gemfile"
16
-
17
- sudo: false
18
-
19
- env:
20
- global:
21
- - VERBOSE=true
22
- - TIMEOUT=1
23
- matrix:
24
- - conn=ruby REDIS_BRANCH=3.0
25
- - conn=ruby REDIS_BRANCH=3.2
26
- - conn=hiredis REDIS_BRANCH=3.0
27
- - conn=hiredis REDIS_BRANCH=3.2
28
- - conn=synchrony REDIS_BRANCH=3.0
29
- - conn=synchrony REDIS_BRANCH=3.2
30
- - conn=ruby REDIS_BRANCH=unstable
31
-
32
- branches:
33
- only:
34
- - master
35
-
36
- matrix:
37
- exclude:
38
- # hiredis
39
- - rvm: jruby-18mode
40
- gemfile: .travis/Gemfile
41
- env: conn=hiredis REDIS_BRANCH=3.0
42
- - rvm: jruby-18mode
43
- gemfile: .travis/Gemfile
44
- env: conn=hiredis REDIS_BRANCH=3.2
45
- - rvm: jruby-19mode
46
- gemfile: .travis/Gemfile
47
- env: conn=hiredis REDIS_BRANCH=3.0
48
- - rvm: jruby-19mode
49
- gemfile: .travis/Gemfile
50
- env: conn=hiredis REDIS_BRANCH=3.2
51
- - rvm: jruby-9.0.5.0
52
- gemfile: .travis/Gemfile
53
- env: conn=hiredis REDIS_BRANCH=3.0
54
- - rvm: jruby-9.0.5.0
55
- gemfile: .travis/Gemfile
56
- env: conn=hiredis REDIS_BRANCH=3.2
57
-
58
- # synchrony
59
- - rvm: 1.8.7
60
- gemfile: .travis/Gemfile
61
- env: conn=synchrony REDIS_BRANCH=3.0
62
- - rvm: 1.8.7
63
- gemfile: .travis/Gemfile
64
- env: conn=synchrony REDIS_BRANCH=3.2
65
- - rvm: jruby-18mode
66
- gemfile: .travis/Gemfile
67
- env: conn=synchrony REDIS_BRANCH=3.0
68
- - rvm: jruby-18mode
69
- gemfile: .travis/Gemfile
70
- env: conn=synchrony REDIS_BRANCH=3.2
71
- - rvm: jruby-19mode
72
- gemfile: .travis/Gemfile
73
- env: conn=synchrony REDIS_BRANCH=3.0
74
- - rvm: jruby-19mode
75
- gemfile: .travis/Gemfile
76
- env: conn=synchrony REDIS_BRANCH=3.2
77
- - rvm: jruby-9.0.5.0
78
- gemfile: .travis/Gemfile
79
- env: conn=synchrony REDIS_BRANCH=3.0
80
- - rvm: jruby-9.0.5.0
81
- gemfile: .travis/Gemfile
82
- env: conn=synchrony REDIS_BRANCH=3.2
83
- allow_failures:
84
- - rvm: rbx-2
85
-
86
- notifications:
87
- irc:
88
- - irc.freenode.net#redis-rb
89
- email: false
@@ -1,11 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec :path => "../"
4
-
5
- case ENV["conn"]
6
- when "hiredis"
7
- gem "hiredis"
8
- when "synchrony"
9
- gem "hiredis"
10
- gem "em-synchrony"
11
- end
data/.yardopts DELETED
@@ -1,3 +0,0 @@
1
- --exclude redis/connection
2
- --exclude redis/compat
3
- --markup markdown
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- # encoding: utf-8
2
- source 'https://rubygems.org'
3
-
4
- gemspec
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