testcontainers-redis 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca35e10e3cf74f54fde8d1701bb3d275176bc511e4759d9065daf0d5885a27bd
4
- data.tar.gz: 47bc00397d4d39c5824bba2691bef242e68c52e7525a695627da5e408ade997e
3
+ metadata.gz: 7e00c2f505258e7186ba75adeb008d0769d60912737ab4ce141c1f2e53bc553f
4
+ data.tar.gz: 6437e63d46de0529e0b5790c1697c472bd9bd952921decdab09f89eb5ceca739
5
5
  SHA512:
6
- metadata.gz: 3c196752899a7430b2b0ed79e955248c5f220961de30d40046e4d7f7973a29eebf6a9d474154c3a98114f389432a97595b81239aad0c7e7fb86b3bc5d0ffe4dd
7
- data.tar.gz: 0afd3c2cf257ad42f6d725cea831050987c10f647a9800d99d6172f8237740de1cc2b47650155e37d251976ad941ce9534605dd3cc21b263cea9505a2c2e21f5
6
+ metadata.gz: 429de9c3cf95c0a3205f3771a8f1440f3902d428489e1c401804c8620b1d8b782e6e8ca45167aa252d7327c022a999247cf44c794705d7d6e6e59a645bc1f640
7
+ data.tar.gz: cb59347e75a6104f3b7bd6d4622061e418c9bd4fc90ee2d7a9688dc944615a0fb4f57998d725588b9a21d88d8557885a829988007328762bfe7e313a422f4c88
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [0.1.1] - 2023-6-10
2
+
3
+ ### Added
4
+
5
+ - Add healthcheck support on start
6
+
7
+ ### Fixed
8
+
9
+ - Remove support for custom password and port, those aren't supported by
10
+ Redis images
11
+
1
12
  ## [0.1.0] - 2023-05-13
2
13
 
3
14
  ### Added
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: ../core
3
3
  specs:
4
- testcontainers-core (0.1.1)
4
+ testcontainers-core (0.1.3)
5
5
  docker-api (~> 2.2)
6
6
 
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- testcontainers-redis (0.1.0)
11
- testcontainers-core (~> 0.1.1)
10
+ testcontainers-redis (0.1.1)
11
+ testcontainers-core (~> 0.1.3)
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
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/guilleiguaran/testcontainers-ruby/blob/main/examples/redis_container_rspec.rb) for a example using RSpec.
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/guilleiguaran/testcontainers. 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/guilleiguaran/testcontainers-ruby/blob/main/CODE_OF_CONDUCT.md).
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/guilleiguaran/testcontainers-ruby/blob/main/CODE_OF_CONDUCT.md).
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).
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Testcontainers
4
4
  module Redis
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
@@ -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, port: nil, **kwargs)
19
+ def initialize(image = REDIS_DEFAULT_IMAGE, **kwargs)
25
20
  super(image, **kwargs)
26
- @port = port || ENV.fetch("REDIS_PORT", REDIS_DEFAULT_PORT)
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(@port)
35
- _configure
28
+ with_exposed_ports(port)
36
29
  super
37
30
  end
38
31
 
39
- # Sets the password to use
32
+ # Returns the port used by the container
40
33
  #
41
- # @param password [String] the password to use
42
- # @return [RedisContainer] self
43
- def with_password(password)
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillermo Iguaran
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-13 00:00:00.000000000 Z
11
+ date: 2023-06-10 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.2
19
+ version: 0.1.3
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.2
26
+ version: 0.1.3
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/guilleiguaran/testcontainers-ruby
113
+ homepage: https://github.com/testcontainers/testcontainers-ruby
114
114
  licenses:
115
115
  - MIT
116
116
  metadata:
117
- homepage_uri: https://github.com/guilleiguaran/testcontainers-ruby/blob/main/redis
118
- source_code_uri: https://github.com/guilleiguaran/testcontainers-ruby/blob/main/redis
119
- changelog_uri: https://github.com/guilleiguaran/testcontainers-ruby/blob/main/redis/CHANGELOG.md
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: