diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 50c587b..c481f6d 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -13,8 +13,9 @@ jobs: ruby-version: - "3.3" - "3.4" + - "4.0" steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: bundler-cache: true 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 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