testcontainers-redis 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +4 -3
- data/README.md +3 -3
- data/lib/testcontainers/redis/version.rb +1 -1
- data/lib/testcontainers/redis.rb +7 -22
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bef14c0181c6daaed89ca2099a1f1f6d70d45a9f6bf3f2533b3272f6c0a1ecd
|
4
|
+
data.tar.gz: fdcf26c7ffac1ba1e63631e614c093d1222e705ae1baa147c99d8d4be8b60f6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ccd47a2cc32b232a77c4b111598b2ed3634546be49782a93757c003f146eb0e264f9209d753324b33e89b517503bc683f883f23b617bd1586abd14dbc662785
|
7
|
+
data.tar.gz: b0569d4322d93c6cceb9ae3684ed0d3ece2787d859ec0a00b5748baa005e2e8217b180a3cfdf6d73d6be141d66e14db897278ca40b6ee7be6735f04d076f2ec3
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../core
|
3
3
|
specs:
|
4
|
-
testcontainers-core (0.
|
4
|
+
testcontainers-core (0.2.0)
|
5
5
|
docker-api (~> 2.2)
|
6
6
|
|
7
7
|
PATH
|
8
8
|
remote: .
|
9
9
|
specs:
|
10
|
-
testcontainers-redis (0.
|
11
|
-
testcontainers-core (~> 0.1
|
10
|
+
testcontainers-redis (0.2.0)
|
11
|
+
testcontainers-core (~> 0.1)
|
12
12
|
|
13
13
|
GEM
|
14
14
|
remote: https://rubygems.org/
|
@@ -68,6 +68,7 @@ GEM
|
|
68
68
|
|
69
69
|
PLATFORMS
|
70
70
|
arm64-darwin-21
|
71
|
+
ruby
|
71
72
|
|
72
73
|
DEPENDENCIES
|
73
74
|
minitest (~> 5.0)
|
data/README.md
CHANGED
@@ -134,11 +134,11 @@ This example creates a Redis container, connects to it using the `redis` gem, se
|
|
134
134
|
|
135
135
|
### Example with RSpec
|
136
136
|
|
137
|
-
Take a look to the files [examples/redis_container_rspec.rb](https://github.com/
|
137
|
+
Take a look to the files [examples/redis_container_rspec.rb](https://github.com/testcontainers/testcontainers-ruby/blob/main/examples/redis_container_rspec.rb) for a example using RSpec.
|
138
138
|
|
139
139
|
## Contributing
|
140
140
|
|
141
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
141
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/testcontainers/testcontainers-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/testcontainers/testcontainers-ruby/blob/main/CODE_OF_CONDUCT.md).
|
142
142
|
|
143
143
|
## License
|
144
144
|
|
@@ -146,4 +146,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
146
146
|
|
147
147
|
## Code of Conduct
|
148
148
|
|
149
|
-
Everyone interacting in the Testcontainers project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
149
|
+
Everyone interacting in the Testcontainers project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/testcontainers/testcontainers-ruby/blob/main/CODE_OF_CONDUCT.md).
|
data/lib/testcontainers/redis.rb
CHANGED
@@ -3,9 +3,6 @@ require "testcontainers"
|
|
3
3
|
|
4
4
|
module Testcontainers
|
5
5
|
# RedisContainer class is used to manage containers that run a Redis database
|
6
|
-
#
|
7
|
-
# @attr_reader [String] port used by the container
|
8
|
-
# @attr_reader [String] password used by the container
|
9
6
|
class RedisContainer < ::Testcontainers::DockerContainer
|
10
7
|
# Default port used by the container
|
11
8
|
REDIS_DEFAULT_PORT = 6379
|
@@ -13,36 +10,30 @@ module Testcontainers
|
|
13
10
|
# Default image used by the container
|
14
11
|
REDIS_DEFAULT_IMAGE = "redis:latest"
|
15
12
|
|
16
|
-
attr_reader :port, :password
|
17
|
-
|
18
13
|
# Initializes a new instance of RedisContainer
|
19
14
|
#
|
20
15
|
# @param image [String] the image to use
|
21
16
|
# @param port [String] the port to use
|
22
17
|
# @param kwargs [Hash] the options to pass to the container. See {DockerContainer#initialize}
|
23
18
|
# @return [RedisContainer] a new instance of RedisContainer
|
24
|
-
def initialize(image = REDIS_DEFAULT_IMAGE,
|
19
|
+
def initialize(image = REDIS_DEFAULT_IMAGE, **kwargs)
|
25
20
|
super(image, **kwargs)
|
26
|
-
@
|
27
|
-
@password = password || ENV.fetch("REDIS_PASSWORD", nil)
|
21
|
+
@wait_for ||= add_wait_for(:logs, /Ready to accept connections/)
|
28
22
|
end
|
29
23
|
|
30
24
|
# Starts the container
|
31
25
|
#
|
32
26
|
# @return [RedisContainer] self
|
33
27
|
def start
|
34
|
-
with_exposed_ports(
|
35
|
-
_configure
|
28
|
+
with_exposed_ports(port)
|
36
29
|
super
|
37
30
|
end
|
38
31
|
|
39
|
-
#
|
32
|
+
# Returns the port used by the container
|
40
33
|
#
|
41
|
-
# @
|
42
|
-
|
43
|
-
|
44
|
-
@password = password
|
45
|
-
self
|
34
|
+
# @return [Integer] the port used by the container
|
35
|
+
def port
|
36
|
+
REDIS_DEFAULT_PORT
|
46
37
|
end
|
47
38
|
|
48
39
|
# Returns the Redis connection url (e.g. redis://:password@localhost:6379/0)
|
@@ -60,11 +51,5 @@ module Testcontainers
|
|
60
51
|
end
|
61
52
|
|
62
53
|
alias_method :database_url, :redis_url
|
63
|
-
|
64
|
-
private
|
65
|
-
|
66
|
-
def _configure
|
67
|
-
add_env("REDIS_PASSWORD", @password) unless @password.nil? || @password.empty?
|
68
|
-
end
|
69
54
|
end
|
70
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testcontainers-redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillermo Iguaran
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: testcontainers-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1
|
19
|
+
version: '0.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1
|
26
|
+
version: '0.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,13 +110,13 @@ files:
|
|
110
110
|
- Rakefile
|
111
111
|
- lib/testcontainers/redis.rb
|
112
112
|
- lib/testcontainers/redis/version.rb
|
113
|
-
homepage: https://github.com/
|
113
|
+
homepage: https://github.com/testcontainers/testcontainers-ruby
|
114
114
|
licenses:
|
115
115
|
- MIT
|
116
116
|
metadata:
|
117
|
-
homepage_uri: https://github.com/
|
118
|
-
source_code_uri: https://github.com/
|
119
|
-
changelog_uri: https://github.com/
|
117
|
+
homepage_uri: https://github.com/testcontainers/testcontainers-ruby/blob/main/redis
|
118
|
+
source_code_uri: https://github.com/testcontainers/testcontainers-ruby/blob/main/redis
|
119
|
+
changelog_uri: https://github.com/testcontainers/testcontainers-ruby/blob/main/redis/CHANGELOG.md
|
120
120
|
post_install_message:
|
121
121
|
rdoc_options: []
|
122
122
|
require_paths:
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
|
-
rubygems_version: 3.4.
|
135
|
+
rubygems_version: 3.4.14
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: 'Testcontainers for Ruby: Redis module'
|