From c7726aa461f0f80c9bc2a352d2b3b3a71a16664e Mon Sep 17 00:00:00 2001 From: Alexander Mancevice Date: Thu, 22 Oct 2026 12:06:06 -0400 Subject: [PATCH 1/3] add Compose.reset! method --- README.md | 6 ++++++ lib/compose.rb | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 0278349..454efad 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,9 @@ development: port: <%= ENV.fetch('REDIS_PORT') { Config.port(:redis, 6379) } %> url: <%= ENV.fetch('REDIS_URL') { Config.port(:redis, 6379, 'redis://localhost:%s/') } %> ``` + +Reset the cached map of ports with: + +```ruby +Compose.reset! +``` diff --git a/lib/compose.rb b/lib/compose.rb index 7ae58ce..a89cf87 100644 --- a/lib/compose.rb +++ b/lib/compose.rb @@ -36,4 +36,8 @@ def self.enabled? ENV['RAILS_DISABLE_COMPOSE'].to_s.empty? && Kernel.system('docker', '--version', out: File::NULL, err: File::NULL) end + + def self.reset! + @ports = nil + end end From 15870f0725bf4f851037b4311a67ad8c70ebcb06 Mon Sep 17 00:00:00 2001 From: Alexander Mancevice Date: Thu, 22 Oct 2026 12:08:23 -0400 Subject: [PATCH 2/3] lint fix --- .github/workflows/rspec.yml | 2 +- spec/compose_spec.rb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 50c587b..1f4724c 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -14,7 +14,7 @@ jobs: - "3.3" - "3.4" steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: bundler-cache: true diff --git a/spec/compose_spec.rb b/spec/compose_spec.rb index d529796..1072307 100644 --- a/spec/compose_spec.rb +++ b/spec/compose_spec.rb @@ -24,7 +24,6 @@ .and_return false end - it 'returns false' do expect(described_class.enabled?).to be false end From cc43829ce36f7869cf5c3b75e2800ae02dc3522b Mon Sep 17 00:00:00 2001 From: Alexander Mancevice Date: Thu, 22 Oct 2026 12:08:45 -0400 Subject: [PATCH 3/3] test Ruby v4.0 --- .github/workflows/rspec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 1f4724c..c481f6d 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -13,6 +13,7 @@ jobs: ruby-version: - "3.3" - "3.4" + - "4.0" steps: - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1