redis-client 0.3.0 → 0.4.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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/Gemfile +1 -2
  4. data/Gemfile.lock +1 -2
  5. data/README.md +5 -9
  6. data/Rakefile +41 -22
  7. data/lib/redis_client/version.rb +1 -1
  8. data/lib/redis_client.rb +1 -6
  9. data/redis-client.gemspec +2 -4
  10. metadata +6 -56
  11. data/.rubocop.yml +0 -191
  12. data/ext/redis_client/hiredis/export.clang +0 -2
  13. data/ext/redis_client/hiredis/export.gcc +0 -7
  14. data/ext/redis_client/hiredis/extconf.rb +0 -69
  15. data/ext/redis_client/hiredis/hiredis_connection.c +0 -708
  16. data/ext/redis_client/hiredis/vendor/.gitignore +0 -9
  17. data/ext/redis_client/hiredis/vendor/.travis.yml +0 -131
  18. data/ext/redis_client/hiredis/vendor/CHANGELOG.md +0 -364
  19. data/ext/redis_client/hiredis/vendor/CMakeLists.txt +0 -165
  20. data/ext/redis_client/hiredis/vendor/COPYING +0 -29
  21. data/ext/redis_client/hiredis/vendor/Makefile +0 -308
  22. data/ext/redis_client/hiredis/vendor/README.md +0 -664
  23. data/ext/redis_client/hiredis/vendor/adapters/ae.h +0 -130
  24. data/ext/redis_client/hiredis/vendor/adapters/glib.h +0 -156
  25. data/ext/redis_client/hiredis/vendor/adapters/ivykis.h +0 -84
  26. data/ext/redis_client/hiredis/vendor/adapters/libev.h +0 -179
  27. data/ext/redis_client/hiredis/vendor/adapters/libevent.h +0 -175
  28. data/ext/redis_client/hiredis/vendor/adapters/libuv.h +0 -117
  29. data/ext/redis_client/hiredis/vendor/adapters/macosx.h +0 -115
  30. data/ext/redis_client/hiredis/vendor/adapters/qt.h +0 -135
  31. data/ext/redis_client/hiredis/vendor/alloc.c +0 -86
  32. data/ext/redis_client/hiredis/vendor/alloc.h +0 -91
  33. data/ext/redis_client/hiredis/vendor/appveyor.yml +0 -24
  34. data/ext/redis_client/hiredis/vendor/async.c +0 -887
  35. data/ext/redis_client/hiredis/vendor/async.h +0 -147
  36. data/ext/redis_client/hiredis/vendor/async_private.h +0 -75
  37. data/ext/redis_client/hiredis/vendor/dict.c +0 -352
  38. data/ext/redis_client/hiredis/vendor/dict.h +0 -126
  39. data/ext/redis_client/hiredis/vendor/fmacros.h +0 -12
  40. data/ext/redis_client/hiredis/vendor/hiredis-config.cmake.in +0 -13
  41. data/ext/redis_client/hiredis/vendor/hiredis.c +0 -1174
  42. data/ext/redis_client/hiredis/vendor/hiredis.h +0 -336
  43. data/ext/redis_client/hiredis/vendor/hiredis.pc.in +0 -12
  44. data/ext/redis_client/hiredis/vendor/hiredis_ssl-config.cmake.in +0 -13
  45. data/ext/redis_client/hiredis/vendor/hiredis_ssl.h +0 -157
  46. data/ext/redis_client/hiredis/vendor/hiredis_ssl.pc.in +0 -12
  47. data/ext/redis_client/hiredis/vendor/net.c +0 -612
  48. data/ext/redis_client/hiredis/vendor/net.h +0 -56
  49. data/ext/redis_client/hiredis/vendor/read.c +0 -739
  50. data/ext/redis_client/hiredis/vendor/read.h +0 -129
  51. data/ext/redis_client/hiredis/vendor/sds.c +0 -1289
  52. data/ext/redis_client/hiredis/vendor/sds.h +0 -278
  53. data/ext/redis_client/hiredis/vendor/sdsalloc.h +0 -44
  54. data/ext/redis_client/hiredis/vendor/sockcompat.c +0 -248
  55. data/ext/redis_client/hiredis/vendor/sockcompat.h +0 -92
  56. data/ext/redis_client/hiredis/vendor/ssl.c +0 -544
  57. data/ext/redis_client/hiredis/vendor/test.c +0 -1401
  58. data/ext/redis_client/hiredis/vendor/test.sh +0 -78
  59. data/ext/redis_client/hiredis/vendor/win32.h +0 -56
  60. data/lib/redis_client/hiredis_connection.rb +0 -93
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '097ad5acec4f5ea01788629c3fe2c606e54c1a2a0749c4e489487cf6bd446eae'
4
- data.tar.gz: 275d778806cb7848d99ddcba33f1e932853efc9f0d149d6409692d1b39452d86
3
+ metadata.gz: 6bd28ab66722c23791118818d83505de8cbc1b141c75959f2408b8a0c90cb6ad
4
+ data.tar.gz: 30f85f2bb0df340facd9a743f63dcfd2ff8fa8b8a3e363c9fdeb2f1101d5d076
5
5
  SHA512:
6
- metadata.gz: c553d706fe8b955a0c6b65a28e9d6a1ddcdec156a562ec5092396a0bca9fa72a251441b8675484fff2d4db3d8e2f335043d226bb4c9c3359e84acc9b7605543f
7
- data.tar.gz: 68dcc5d81b1632dd60d22651d0ef600903fe607230d3ac396d5e98aab7694d374d5e577777234d7e514fc4df04b332e0fdb31b3c9971fb116c6b0e87c1ddc5f5
6
+ metadata.gz: 528b4cd6f9377f083a19ca1da7b117625ad32c1849c8cc53d795dc5af8e6d23c372fdb5714c043b7c796a6fcfda54ef28ee0142268846445cbfb60e00eabf625
7
+ data.tar.gz: af0040e6a5cf498587818b5161122d57e3057a39a22d0eb5fc8252e4cb56e71ad61c0a381fbe35c75cd6f5e5e2998169487e33b74f7635f7e025f6e06d7351ca
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Unreleased
2
2
 
3
+ # 0.4.0
4
+
5
+ - The `hiredis` driver have been moved to the `hiredis-client` gem.
6
+
3
7
  # 0.3.0
4
8
 
5
9
  - `hiredis` is now the default driver when available.
data/Gemfile CHANGED
@@ -3,9 +3,8 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in redis-client.gemspec
6
- gemspec
6
+ gemspec name: "redis-client"
7
7
 
8
- gem "connection_pool"
9
8
  gem "minitest"
10
9
  gem "rake", "~> 13.0"
11
10
  gem "rake-compiler"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- redis-client (0.3.0)
4
+ redis-client (0.4.0)
5
5
  connection_pool
6
6
 
7
7
  GEM
@@ -51,7 +51,6 @@ PLATFORMS
51
51
  DEPENDENCIES
52
52
  benchmark-ips
53
53
  byebug
54
- connection_pool
55
54
  hiredis
56
55
  minitest
57
56
  rake (~> 13.0)
data/README.md CHANGED
@@ -389,21 +389,17 @@ redis.call_once("INCR", "counter") # Won't be retried.
389
389
 
390
390
  ### Drivers
391
391
 
392
- `redis-client` ships with two connection implementations, a `hiredis` binding and a pure Ruby implementation.
392
+ `redis-client` ships with a pure Ruby socket implementation.
393
393
 
394
- The hiredis binding is only available on Linux, macOS and other POSIX platforms. When available it is the default.
395
-
396
- The default driver can be set through `RedisClient.default_driver=`:
394
+ For increased performance, you can enable the `hiredis` binding by adding `hiredis-client` to your Gemfile:
397
395
 
398
396
  ```ruby
399
- RedisClient.default_driver = :ruby
397
+ gem "hiredis-client"
400
398
  ```
401
399
 
402
- You can also select the driver on a per connection basis:
400
+ The hiredis binding is only available on Linux, macOS and other POSIX platforms. You can install the gem on other platforms, but it won't have any effect.
403
401
 
404
- ```ruby
405
- redis_config = RedisClient.config(driver: :ruby, ...)
406
- ```
402
+ The default driver can be set through `RedisClient.default_driver=`:
407
403
 
408
404
  ## Notable differences with the `redis` gem
409
405
 
data/Rakefile CHANGED
@@ -1,34 +1,53 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/gem_tasks"
4
3
  require "rake/extensiontask"
5
4
  require "rake/testtask"
6
5
  require 'rubocop/rake_task'
7
6
 
8
7
  RuboCop::RakeTask.new
9
8
 
9
+ require "rake/clean"
10
+ CLOBBER.include "pkg"
11
+ require "bundler/gem_helper"
12
+ Bundler::GemHelper.install_tasks(name: "redis-client")
13
+ Bundler::GemHelper.install_tasks(dir: "hiredis-client", name: "hiredis-client")
14
+
10
15
  gemspec = Gem::Specification.load("redis-client.gemspec")
11
16
  Rake::ExtensionTask.new do |ext|
12
17
  ext.name = "hiredis_connection"
13
- ext.ext_dir = "ext/redis_client/hiredis"
14
- ext.lib_dir = "lib/redis_client"
18
+ ext.ext_dir = "hiredis-client/ext/redis_client/hiredis"
19
+ ext.lib_dir = "hiredis-client/lib/redis_client"
15
20
  ext.gem_spec = gemspec
16
21
  CLEAN.add("#{ext.ext_dir}/vendor/*.{a,o}")
17
22
  end
18
23
 
19
- Rake::TestTask.new(:test) do |t|
20
- t.libs << "test"
21
- t.libs << "lib"
22
- t.test_files = FileList["test/**/*_test.rb"].exclude("test/sentinel/*_test.rb")
23
- end
24
-
25
24
  namespace :test do
25
+ Rake::TestTask.new(:ruby) do |t|
26
+ t.libs << "test"
27
+ t.libs << "lib"
28
+ t.test_files = FileList["test/**/*_test.rb"].exclude("test/sentinel/*_test.rb")
29
+ end
30
+
26
31
  Rake::TestTask.new(:sentinel) do |t|
27
32
  t.libs << "test/sentinel"
28
33
  t.libs << "test"
29
34
  t.libs << "lib"
30
35
  t.test_files = FileList["test/sentinel/*_test.rb"]
31
36
  end
37
+
38
+ Rake::TestTask.new(:hiredis) do |t|
39
+ t.libs << "test/hiredis"
40
+ t.libs << "test"
41
+ t.libs << "lib"
42
+ t.test_files = FileList["test/**/*_test.rb"].exclude("test/sentinel/*_test.rb")
43
+ end
44
+ end
45
+
46
+ hiredis_supported = RUBY_ENGINE == "ruby" && !RUBY_PLATFORM.match?(/mswin/)
47
+ if hiredis_supported
48
+ task test: %i[test:ruby test:hiredis test:sentinel]
49
+ else
50
+ task test: %i[test:ruby test:sentinel]
32
51
  end
33
52
 
34
53
  namespace :hiredis do
@@ -37,10 +56,14 @@ namespace :hiredis do
37
56
  archive_path = "tmp/hiredis-#{version}.tar.gz"
38
57
  url = "https://github.com/redis/hiredis/archive/refs/tags/v#{version}.tar.gz"
39
58
  system("curl", "-L", url, out: archive_path) or raise "Downloading of #{url} failed"
40
- system("rm", "-rf", "ext/redis_client/hiredis/vendor/")
41
- system("mkdir", "-p", "ext/redis_client/hiredis/vendor/")
42
- system("tar", "xvzf", archive_path, "-C", "ext/redis_client/hiredis/vendor", "--strip-components", "1")
43
- system("rm", "-rf", "ext/redis_client/hiredis/vendor/examples")
59
+ system("rm", "-rf", "hiredis-client/ext/redis_client/hiredis/vendor/")
60
+ system("mkdir", "-p", "hiredis-client/ext/redis_client/hiredis/vendor/")
61
+ system(
62
+ "tar", "xvzf", archive_path,
63
+ "-C", "hiredis-client/ext/redis_client/hiredis/vendor",
64
+ "--strip-components", "1",
65
+ )
66
+ system("rm", "-rf", "hiredis-client/ext/redis_client/hiredis/vendor/examples")
44
67
  end
45
68
  end
46
69
 
@@ -82,14 +105,10 @@ namespace :benchmark do
82
105
  end
83
106
  end
84
107
 
85
- if RUBY_PLATFORM == "java"
86
- task default: %i[test test:sentinel rubocop]
87
- else
88
- task default: %i[compile test test:sentinel rubocop]
89
- end
90
-
91
- if ENV["DRIVER"] == "hiredis"
92
- task ci: %i[compile test test:sentinel]
108
+ if hiredis_supported
109
+ task default: %i[compile test rubocop]
110
+ task ci: %i[compile test]
93
111
  else
94
- task ci: %i[test test:sentinel]
112
+ task default: %i[test rubocop]
113
+ task ci: %i[test]
95
114
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RedisClient
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/redis_client.rb CHANGED
@@ -24,7 +24,7 @@ class RedisClient
24
24
 
25
25
  name = name.to_sym
26
26
  unless @driver_definitions.key?(name)
27
- raise ArgumentError, "Unknown driver #{name.inspect}, expected one of: `#{DRIVER_DEFINITIONS.keys.inspect}`"
27
+ raise ArgumentError, "Unknown driver #{name.inspect}, expected one of: `#{@driver_definitions.keys.inspect}`"
28
28
  end
29
29
 
30
30
  @drivers[name] ||= @driver_definitions[name]&.call
@@ -47,11 +47,6 @@ class RedisClient
47
47
  end
48
48
  end
49
49
 
50
- register_driver :hiredis do
51
- require "redis_client/hiredis_connection"
52
- HiredisConnection
53
- end
54
-
55
50
  register_driver :ruby do
56
51
  require "redis_client/ruby_connection"
57
52
  RubyConnection
data/redis-client.gemspec CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = "Simple low-level client for Redis 6+"
12
12
  spec.homepage = "https://github.com/redis-rb/redis-client"
13
+ spec.license = "MIT"
13
14
  spec.required_ruby_version = ">= 2.5.0"
14
15
 
15
16
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
@@ -22,13 +23,10 @@ Gem::Specification.new do |spec|
22
23
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
24
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
25
  `git ls-files -z`.split("\x0").reject do |f|
25
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features|benchmark)/|\.(?:git|travis|circleci)|appveyor)})
26
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|hiredis-client|test|spec|features|benchmark)/|\.(?:git|rubocop))})
26
27
  end
27
28
  end
28
- spec.bindir = "exe"
29
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
29
  spec.require_paths = ["lib"]
31
- spec.extensions = ["ext/redis_client/hiredis/extconf.rb"]
32
30
 
33
31
  spec.add_runtime_dependency "connection_pool"
34
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-05 00:00:00.000000000 Z
11
+ date: 2022-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -28,72 +28,21 @@ description:
28
28
  email:
29
29
  - jean.boussier@gmail.com
30
30
  executables: []
31
- extensions:
32
- - ext/redis_client/hiredis/extconf.rb
31
+ extensions: []
33
32
  extra_rdoc_files: []
34
33
  files:
35
- - ".rubocop.yml"
36
34
  - CHANGELOG.md
37
35
  - Gemfile
38
36
  - Gemfile.lock
39
37
  - LICENSE.md
40
38
  - README.md
41
39
  - Rakefile
42
- - ext/redis_client/hiredis/export.clang
43
- - ext/redis_client/hiredis/export.gcc
44
- - ext/redis_client/hiredis/extconf.rb
45
- - ext/redis_client/hiredis/hiredis_connection.c
46
- - ext/redis_client/hiredis/vendor/.gitignore
47
- - ext/redis_client/hiredis/vendor/.travis.yml
48
- - ext/redis_client/hiredis/vendor/CHANGELOG.md
49
- - ext/redis_client/hiredis/vendor/CMakeLists.txt
50
- - ext/redis_client/hiredis/vendor/COPYING
51
- - ext/redis_client/hiredis/vendor/Makefile
52
- - ext/redis_client/hiredis/vendor/README.md
53
- - ext/redis_client/hiredis/vendor/adapters/ae.h
54
- - ext/redis_client/hiredis/vendor/adapters/glib.h
55
- - ext/redis_client/hiredis/vendor/adapters/ivykis.h
56
- - ext/redis_client/hiredis/vendor/adapters/libev.h
57
- - ext/redis_client/hiredis/vendor/adapters/libevent.h
58
- - ext/redis_client/hiredis/vendor/adapters/libuv.h
59
- - ext/redis_client/hiredis/vendor/adapters/macosx.h
60
- - ext/redis_client/hiredis/vendor/adapters/qt.h
61
- - ext/redis_client/hiredis/vendor/alloc.c
62
- - ext/redis_client/hiredis/vendor/alloc.h
63
- - ext/redis_client/hiredis/vendor/appveyor.yml
64
- - ext/redis_client/hiredis/vendor/async.c
65
- - ext/redis_client/hiredis/vendor/async.h
66
- - ext/redis_client/hiredis/vendor/async_private.h
67
- - ext/redis_client/hiredis/vendor/dict.c
68
- - ext/redis_client/hiredis/vendor/dict.h
69
- - ext/redis_client/hiredis/vendor/fmacros.h
70
- - ext/redis_client/hiredis/vendor/hiredis-config.cmake.in
71
- - ext/redis_client/hiredis/vendor/hiredis.c
72
- - ext/redis_client/hiredis/vendor/hiredis.h
73
- - ext/redis_client/hiredis/vendor/hiredis.pc.in
74
- - ext/redis_client/hiredis/vendor/hiredis_ssl-config.cmake.in
75
- - ext/redis_client/hiredis/vendor/hiredis_ssl.h
76
- - ext/redis_client/hiredis/vendor/hiredis_ssl.pc.in
77
- - ext/redis_client/hiredis/vendor/net.c
78
- - ext/redis_client/hiredis/vendor/net.h
79
- - ext/redis_client/hiredis/vendor/read.c
80
- - ext/redis_client/hiredis/vendor/read.h
81
- - ext/redis_client/hiredis/vendor/sds.c
82
- - ext/redis_client/hiredis/vendor/sds.h
83
- - ext/redis_client/hiredis/vendor/sdsalloc.h
84
- - ext/redis_client/hiredis/vendor/sockcompat.c
85
- - ext/redis_client/hiredis/vendor/sockcompat.h
86
- - ext/redis_client/hiredis/vendor/ssl.c
87
- - ext/redis_client/hiredis/vendor/test.c
88
- - ext/redis_client/hiredis/vendor/test.sh
89
- - ext/redis_client/hiredis/vendor/win32.h
90
40
  - lib/redis-client.rb
91
41
  - lib/redis_client.rb
92
42
  - lib/redis_client/command_builder.rb
93
43
  - lib/redis_client/config.rb
94
44
  - lib/redis_client/connection_mixin.rb
95
45
  - lib/redis_client/decorator.rb
96
- - lib/redis_client/hiredis_connection.rb
97
46
  - lib/redis_client/middlewares.rb
98
47
  - lib/redis_client/pooled.rb
99
48
  - lib/redis_client/ruby_connection.rb
@@ -103,7 +52,8 @@ files:
103
52
  - lib/redis_client/version.rb
104
53
  - redis-client.gemspec
105
54
  homepage: https://github.com/redis-rb/redis-client
106
- licenses: []
55
+ licenses:
56
+ - MIT
107
57
  metadata:
108
58
  allowed_push_host: https://rubygems.org
109
59
  homepage_uri: https://github.com/redis-rb/redis-client
data/.rubocop.yml DELETED
@@ -1,191 +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
- - 'benchmark/**/*'
11
-
12
- Layout/CaseIndentation:
13
- EnforcedStyle: end
14
-
15
- Layout/LineEndStringConcatenationIndentation:
16
- EnforcedStyle: indented
17
-
18
- Layout/ArgumentAlignment:
19
- EnforcedStyle: with_fixed_indentation
20
-
21
- Lint/RescueException:
22
- Enabled: false
23
-
24
- Lint/SuppressedException:
25
- Enabled: false
26
-
27
- Lint/AssignmentInCondition:
28
- Enabled: false
29
-
30
- Lint/UnifiedInteger:
31
- Enabled: false
32
-
33
- Lint/UnderscorePrefixedVariableName:
34
- Enabled: false
35
-
36
- Lint/EmptyBlock:
37
- Enabled: false
38
-
39
- Lint/MissingSuper:
40
- Enabled: false
41
-
42
- Metrics/ClassLength:
43
- Enabled: false
44
-
45
- Metrics/CyclomaticComplexity:
46
- Enabled: false
47
-
48
- Metrics/AbcSize:
49
- Enabled: false
50
-
51
- Metrics/BlockLength:
52
- Enabled: false
53
-
54
- Metrics/MethodLength:
55
- Enabled: false
56
-
57
- Metrics/ModuleLength:
58
- Enabled: false
59
-
60
- Metrics/ParameterLists:
61
- Enabled: false
62
-
63
- Metrics/PerceivedComplexity:
64
- Enabled: false
65
-
66
- Style/Alias:
67
- EnforcedStyle: prefer_alias_method
68
-
69
- Style/PercentLiteralDelimiters:
70
- Enabled: false
71
-
72
- Style/ParallelAssignment:
73
- Enabled: false
74
-
75
- Style/NumericPredicate:
76
- Enabled: false
77
-
78
- Style/NumericLiterals:
79
- Enabled: false
80
-
81
- Style/IfUnlessModifier:
82
- Enabled: false
83
-
84
- Style/SignalException:
85
- Exclude:
86
- - 'lib/redis/connection/synchrony.rb'
87
-
88
- Style/StringLiterals:
89
- Enabled: false
90
-
91
- Style/DoubleNegation:
92
- Enabled: false
93
-
94
- Style/MultipleComparison:
95
- Enabled: false
96
-
97
- Style/GuardClause:
98
- Enabled: false
99
-
100
- Style/Semicolon:
101
- Enabled: false
102
-
103
- Style/Documentation:
104
- Enabled: false
105
-
106
- Style/FormatStringToken:
107
- Enabled: false
108
-
109
- Style/FormatString:
110
- Enabled: false
111
-
112
- Style/RescueStandardError:
113
- Enabled: false
114
-
115
- Style/WordArray:
116
- Enabled: false
117
-
118
- Style/TrailingCommaInArrayLiteral:
119
- EnforcedStyleForMultiline: consistent_comma
120
-
121
- Style/TrailingCommaInHashLiteral:
122
- EnforcedStyleForMultiline: consistent_comma
123
-
124
- Style/TrailingCommaInArguments:
125
- EnforcedStyleForMultiline: consistent_comma
126
-
127
- Lint/NonLocalExitFromIterator:
128
- Enabled: false
129
-
130
- Layout/FirstArrayElementIndentation:
131
- EnforcedStyle: consistent
132
-
133
- Layout/FirstHashElementIndentation:
134
- EnforcedStyle: consistent
135
-
136
- Layout/EndAlignment:
137
- EnforcedStyleAlignWith: variable
138
-
139
- Layout/ElseAlignment:
140
- Enabled: false
141
-
142
- Layout/RescueEnsureAlignment:
143
- Enabled: false
144
-
145
- Naming/HeredocDelimiterNaming:
146
- Enabled: false
147
-
148
- Naming/FileName:
149
- Enabled: false
150
-
151
- Naming/RescuedExceptionsVariableName:
152
- Enabled: false
153
-
154
- Naming/AccessorMethodName:
155
- Exclude:
156
- - lib/redis/connection/ruby.rb
157
-
158
- Naming/MethodParameterName:
159
- Enabled: false
160
-
161
- Metrics/BlockNesting:
162
- Enabled: false
163
-
164
- Style/HashTransformValues:
165
- Enabled: false
166
-
167
- Style/SymbolProc:
168
- Exclude:
169
- - 'test/**/*'
170
-
171
- Style/SoleNestedConditional:
172
- Enabled: false
173
-
174
- Style/GlobalVars:
175
- Exclude:
176
- - 'ext/**/*'
177
-
178
- Gemspec/RequireMFA:
179
- Enabled: false
180
-
181
- Style/StderrPuts:
182
- Enabled: false
183
-
184
- Style/ModuleFunction:
185
- Enabled: false
186
-
187
- Style/CombinableLoops:
188
- Enabled: false
189
-
190
- Style/DocumentDynamicEvalDefinition:
191
- 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,69 +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 = ["static", "USE_SSL=1"]
35
- if openssl_lib
36
- flags << %(CFLAGS="-I#{openssl_include}") << %(SSL_LDFLAGS="-L#{openssl_lib}")
37
- end
38
-
39
- flags << "OPTIMIZATION=-g" if ENV["EXT_PEDANTIC"]
40
-
41
- unless system(make_program, *flags)
42
- raise "Building hiredis failed"
43
- end
44
- end
45
-
46
- $CFLAGS << " -I#{hiredis_dir}"
47
- $LDFLAGS << " -lssl -lcrypto"
48
- $libs << " #{hiredis_dir}/libhiredis.a #{hiredis_dir}/libhiredis_ssl.a "
49
- $CFLAGS << " -std=c99 "
50
- if ENV["EXT_PEDANTIC"]
51
- $CFLAGS << " -Werror"
52
- $CFLAGS << " -g "
53
- else
54
- $CFLAGS << " -O3 "
55
- end
56
-
57
- if `cc --version`.match?(/ clang /i) || RbConfig::CONFIG['CC'].match?(/clang/i)
58
- $LDFLAGS << ' -Wl,-exported_symbols_list,"' << File.join(__dir__, 'export.clang') << '"'
59
- elsif RbConfig::CONFIG['CC'].match?(/gcc/i)
60
- $LDFLAGS << ' -Wl,--version-script="' << File.join(__dir__, 'export.gcc') << '"'
61
- end
62
-
63
- $CFLAGS << " -Wno-declaration-after-statement" # Older compilers
64
- $CFLAGS << " -Wno-compound-token-split-by-macro" # Older rubies on macos
65
-
66
- create_makefile("redis_client/hiredis_connection")
67
- else
68
- File.write("Makefile", dummy_makefile($srcdir).join)
69
- end