Skip to content

Commit

Permalink
Dropped Redis dependency (#68)
Browse files Browse the repository at this point in the history
Starting from Rails 7.0 live reloading works fine with default `async` ActiveCable adapter
  • Loading branch information
kirillplatonov authored Dec 21, 2024
1 parent e361c75 commit 00578f0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ Automatically reload Hotwire Turbo when app files are modified.

https://user-images.githubusercontent.com/839922/148676469-0acfa036-832e-4b40-aa05-1fdd945baa1f.mp4

## Dependencies

* [Redis](https://redis.io/)

## Getting started

Add `hotwire-livereload` to your Gemfile:
Expand Down
16 changes: 0 additions & 16 deletions lib/install/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,3 @@
say %( Add <%= hotwire_livereload_tags %> within the <head> tag in your custom layout.)
say %( If using `config.hotwire_livereload.reload_method = :turbo_stream`, place *after* the `<%= action_cable_meta_tag %>`.)
end

if CABLE_CONFIG_PATH.exist?
gemfile = File.read(Rails.root.join("Gemfile"))
if gemfile.include?("redis")
say "Uncomment redis in Gemfile"
uncomment_lines "Gemfile", %r{gem ['"]redis['"]}
else
say "Add redis to Gemfile"
gem "redis"
end

say "Switch development cable to use redis"
gsub_file CABLE_CONFIG_PATH.to_s, /development:\n\s+adapter: async/, "development:\n adapter: redis\n url: redis://localhost:6379/1"
else
say 'ActionCable config file (config/cable.yml) is missing. Uncomment "gem \'redis\'" in your Gemfile and create config/cable.yml to use Hotwire Livereload.'
end

0 comments on commit 00578f0

Please sign in to comment.