redis-client 0.2.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/Gemfile +1 -2
  4. data/Gemfile.lock +2 -3
  5. data/README.md +71 -8
  6. data/Rakefile +43 -23
  7. data/lib/redis_client/command_builder.rb +91 -0
  8. data/lib/redis_client/config.rb +19 -50
  9. data/lib/redis_client/connection_mixin.rb +40 -0
  10. data/lib/redis_client/decorator.rb +84 -0
  11. data/lib/redis_client/pooled.rb +38 -30
  12. data/lib/redis_client/ruby_connection/buffered_io.rb +153 -0
  13. data/lib/redis_client/{resp3.rb → ruby_connection/resp3.rb} +0 -26
  14. data/lib/redis_client/{connection.rb → ruby_connection.rb} +26 -31
  15. data/lib/redis_client/version.rb +1 -1
  16. data/lib/redis_client.rb +183 -36
  17. data/redis-client.gemspec +2 -4
  18. metadata +12 -59
  19. data/.rubocop.yml +0 -190
  20. data/ext/redis_client/hiredis/export.clang +0 -2
  21. data/ext/redis_client/hiredis/export.gcc +0 -7
  22. data/ext/redis_client/hiredis/extconf.rb +0 -61
  23. data/ext/redis_client/hiredis/hiredis_connection.c +0 -708
  24. data/ext/redis_client/hiredis/vendor/.gitignore +0 -9
  25. data/ext/redis_client/hiredis/vendor/.travis.yml +0 -131
  26. data/ext/redis_client/hiredis/vendor/CHANGELOG.md +0 -364
  27. data/ext/redis_client/hiredis/vendor/CMakeLists.txt +0 -165
  28. data/ext/redis_client/hiredis/vendor/COPYING +0 -29
  29. data/ext/redis_client/hiredis/vendor/Makefile +0 -308
  30. data/ext/redis_client/hiredis/vendor/README.md +0 -664
  31. data/ext/redis_client/hiredis/vendor/adapters/ae.h +0 -130
  32. data/ext/redis_client/hiredis/vendor/adapters/glib.h +0 -156
  33. data/ext/redis_client/hiredis/vendor/adapters/ivykis.h +0 -84
  34. data/ext/redis_client/hiredis/vendor/adapters/libev.h +0 -179
  35. data/ext/redis_client/hiredis/vendor/adapters/libevent.h +0 -175
  36. data/ext/redis_client/hiredis/vendor/adapters/libuv.h +0 -117
  37. data/ext/redis_client/hiredis/vendor/adapters/macosx.h +0 -115
  38. data/ext/redis_client/hiredis/vendor/adapters/qt.h +0 -135
  39. data/ext/redis_client/hiredis/vendor/alloc.c +0 -86
  40. data/ext/redis_client/hiredis/vendor/alloc.h +0 -91
  41. data/ext/redis_client/hiredis/vendor/appveyor.yml +0 -24
  42. data/ext/redis_client/hiredis/vendor/async.c +0 -887
  43. data/ext/redis_client/hiredis/vendor/async.h +0 -147
  44. data/ext/redis_client/hiredis/vendor/async_private.h +0 -75
  45. data/ext/redis_client/hiredis/vendor/dict.c +0 -352
  46. data/ext/redis_client/hiredis/vendor/dict.h +0 -126
  47. data/ext/redis_client/hiredis/vendor/fmacros.h +0 -12
  48. data/ext/redis_client/hiredis/vendor/hiredis-config.cmake.in +0 -13
  49. data/ext/redis_client/hiredis/vendor/hiredis.c +0 -1174
  50. data/ext/redis_client/hiredis/vendor/hiredis.h +0 -336
  51. data/ext/redis_client/hiredis/vendor/hiredis.pc.in +0 -12
  52. data/ext/redis_client/hiredis/vendor/hiredis_ssl-config.cmake.in +0 -13
  53. data/ext/redis_client/hiredis/vendor/hiredis_ssl.h +0 -157
  54. data/ext/redis_client/hiredis/vendor/hiredis_ssl.pc.in +0 -12
  55. data/ext/redis_client/hiredis/vendor/net.c +0 -612
  56. data/ext/redis_client/hiredis/vendor/net.h +0 -56
  57. data/ext/redis_client/hiredis/vendor/read.c +0 -739
  58. data/ext/redis_client/hiredis/vendor/read.h +0 -129
  59. data/ext/redis_client/hiredis/vendor/sds.c +0 -1289
  60. data/ext/redis_client/hiredis/vendor/sds.h +0 -278
  61. data/ext/redis_client/hiredis/vendor/sdsalloc.h +0 -44
  62. data/ext/redis_client/hiredis/vendor/sockcompat.c +0 -248
  63. data/ext/redis_client/hiredis/vendor/sockcompat.h +0 -92
  64. data/ext/redis_client/hiredis/vendor/ssl.c +0 -544
  65. data/ext/redis_client/hiredis/vendor/test.c +0 -1401
  66. data/ext/redis_client/hiredis/vendor/test.sh +0 -78
  67. data/ext/redis_client/hiredis/vendor/win32.h +0 -56
  68. data/lib/redis_client/buffered_io.rb +0 -151
  69. data/lib/redis_client/hiredis_connection.rb +0 -80
data/.rubocop.yml DELETED
@@ -1,190 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.5
3
- NewCops: enable
4
- SuggestExtensions: false
5
-
6
- Layout/LineLength:
7
- Max: 120
8
- Exclude:
9
- - 'test/**/*'
10
-
11
- Layout/CaseIndentation:
12
- EnforcedStyle: end
13
-
14
- Layout/LineEndStringConcatenationIndentation:
15
- EnforcedStyle: indented
16
-
17
- Layout/ArgumentAlignment:
18
- EnforcedStyle: with_fixed_indentation
19
-
20
- Lint/RescueException:
21
- Enabled: false
22
-
23
- Lint/SuppressedException:
24
- Enabled: false
25
-
26
- Lint/AssignmentInCondition:
27
- Enabled: false
28
-
29
- Lint/UnifiedInteger:
30
- Enabled: false
31
-
32
- Lint/UnderscorePrefixedVariableName:
33
- Enabled: false
34
-
35
- Lint/EmptyBlock:
36
- Enabled: false
37
-
38
- Lint/MissingSuper:
39
- Enabled: false
40
-
41
- Metrics/ClassLength:
42
- Enabled: false
43
-
44
- Metrics/CyclomaticComplexity:
45
- Enabled: false
46
-
47
- Metrics/AbcSize:
48
- Enabled: false
49
-
50
- Metrics/BlockLength:
51
- Enabled: false
52
-
53
- Metrics/MethodLength:
54
- Enabled: false
55
-
56
- Metrics/ModuleLength:
57
- Enabled: false
58
-
59
- Metrics/ParameterLists:
60
- Enabled: false
61
-
62
- Metrics/PerceivedComplexity:
63
- Enabled: false
64
-
65
- Style/Alias:
66
- EnforcedStyle: prefer_alias_method
67
-
68
- Style/PercentLiteralDelimiters:
69
- Enabled: false
70
-
71
- Style/ParallelAssignment:
72
- Enabled: false
73
-
74
- Style/NumericPredicate:
75
- Enabled: false
76
-
77
- Style/NumericLiterals:
78
- Enabled: false
79
-
80
- Style/IfUnlessModifier:
81
- Enabled: false
82
-
83
- Style/SignalException:
84
- Exclude:
85
- - 'lib/redis/connection/synchrony.rb'
86
-
87
- Style/StringLiterals:
88
- Enabled: false
89
-
90
- Style/DoubleNegation:
91
- Enabled: false
92
-
93
- Style/MultipleComparison:
94
- Enabled: false
95
-
96
- Style/GuardClause:
97
- Enabled: false
98
-
99
- Style/Semicolon:
100
- Enabled: false
101
-
102
- Style/Documentation:
103
- Enabled: false
104
-
105
- Style/FormatStringToken:
106
- Enabled: false
107
-
108
- Style/FormatString:
109
- Enabled: false
110
-
111
- Style/RescueStandardError:
112
- Enabled: false
113
-
114
- Style/WordArray:
115
- Enabled: false
116
-
117
- Style/TrailingCommaInArrayLiteral:
118
- EnforcedStyleForMultiline: consistent_comma
119
-
120
- Style/TrailingCommaInHashLiteral:
121
- EnforcedStyleForMultiline: consistent_comma
122
-
123
- Style/TrailingCommaInArguments:
124
- EnforcedStyleForMultiline: consistent_comma
125
-
126
- Lint/NonLocalExitFromIterator:
127
- Enabled: false
128
-
129
- Layout/FirstArrayElementIndentation:
130
- EnforcedStyle: consistent
131
-
132
- Layout/FirstHashElementIndentation:
133
- EnforcedStyle: consistent
134
-
135
- Layout/EndAlignment:
136
- EnforcedStyleAlignWith: variable
137
-
138
- Layout/ElseAlignment:
139
- Enabled: false
140
-
141
- Layout/RescueEnsureAlignment:
142
- Enabled: false
143
-
144
- Naming/HeredocDelimiterNaming:
145
- Enabled: false
146
-
147
- Naming/FileName:
148
- Enabled: false
149
-
150
- Naming/RescuedExceptionsVariableName:
151
- Enabled: false
152
-
153
- Naming/AccessorMethodName:
154
- Exclude:
155
- - lib/redis/connection/ruby.rb
156
-
157
- Naming/MethodParameterName:
158
- Enabled: false
159
-
160
- Metrics/BlockNesting:
161
- Enabled: false
162
-
163
- Style/HashTransformValues:
164
- Enabled: false
165
-
166
- Style/SymbolProc:
167
- Exclude:
168
- - 'test/**/*'
169
-
170
- Style/SoleNestedConditional:
171
- Enabled: false
172
-
173
- Style/GlobalVars:
174
- Exclude:
175
- - 'ext/**/*'
176
-
177
- Gemspec/RequireMFA:
178
- Enabled: false
179
-
180
- Style/StderrPuts:
181
- Enabled: false
182
-
183
- Style/ModuleFunction:
184
- Enabled: false
185
-
186
- Style/CombinableLoops:
187
- Enabled: false
188
-
189
- Style/DocumentDynamicEvalDefinition:
190
- Enabled: false
@@ -1,2 +0,0 @@
1
- _Init_hiredis_connection
2
- _ruby_abi_version
@@ -1,7 +0,0 @@
1
- hiredis_connection_1.0 {
2
- global:
3
- Init_hiredis_connection;
4
- ruby_abi_version;
5
- local:
6
- *;
7
- };
@@ -1,61 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "mkmf"
4
-
5
- if RUBY_ENGINE == "ruby" && !RUBY_ENGINE.match?(/mswin/)
6
- have_func("rb_hash_new_capa", "ruby.h")
7
-
8
- hiredis_dir = File.expand_path('vendor', __dir__)
9
-
10
- make_program = with_config("make-prog", ENV["MAKE"])
11
- make_program ||= case RUBY_PLATFORM
12
- when /(bsd|solaris)/
13
- 'gmake'
14
- else
15
- 'make'
16
- end
17
-
18
- openssl_include, openssl_lib = dir_config("openssl")
19
-
20
- openssl_include ||= dir_config("opt").first
21
- &.split(File::PATH_SEPARATOR)
22
- &.detect { |dir| dir.include?("openssl") }
23
-
24
- openssl_lib ||= dir_config("opt").last
25
- &.split(File::PATH_SEPARATOR)
26
- &.detect { |dir| dir.include?("openssl") }
27
-
28
- if (!openssl_include || !openssl_lib) && !have_header("openssl/ssl.h")
29
- raise "OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the " \
30
- "prefix where OpenSSL is installed."
31
- end
32
-
33
- Dir.chdir(hiredis_dir) do
34
- flags = %(CFLAGS="-I#{openssl_include}" SSL_LDFLAGS="-L#{openssl_lib}") if openssl_lib
35
- success = system("#{make_program} static USE_SSL=1 #{flags}")
36
- raise "Building hiredis failed" unless success
37
- end
38
-
39
- $CFLAGS << " -I#{hiredis_dir}"
40
- $LDFLAGS << " -lssl -lcrypto"
41
- $libs << " #{hiredis_dir}/libhiredis.a #{hiredis_dir}/libhiredis_ssl.a "
42
- $CFLAGS << " -O3"
43
- $CFLAGS << " -std=c99 "
44
-
45
- if `cc --version`.match?(/ clang /i) || RbConfig::CONFIG['CC'].match?(/clang/i)
46
- $LDFLAGS << ' -Wl,-exported_symbols_list,"' << File.join(__dir__, 'export.clang') << '"'
47
- elsif RbConfig::CONFIG['CC'].match?(/gcc/i)
48
- $LDFLAGS << ' -Wl,--version-script="' << File.join(__dir__, 'export.gcc') << '"'
49
- end
50
-
51
- if ENV["EXT_PEDANTIC"]
52
- $CFLAGS << " -Werror"
53
- end
54
-
55
- $CFLAGS << " -Wno-declaration-after-statement" # Older compilers
56
- $CFLAGS << " -Wno-compound-token-split-by-macro" # Older rubies on macos
57
-
58
- create_makefile("redis_client/hiredis_connection")
59
- else
60
- File.write("Makefile", dummy_makefile($srcdir).join)
61
- end