Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
```
4 changes: 4 additions & 0 deletions lib/compose.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion spec/compose_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
.and_return false
end


it 'returns false' do
expect(described_class.enabled?).to be false
end
Expand Down
Loading