Sha256: fe321ce2778851fd2d72f1992bfd48ceb97e8c7f6830264f29ab165cccce26bf
Contents?: true
Size: 750 Bytes
Versions: 29
Compression:
Stored size: 750 Bytes
Contents
if (cable_config_path = Rails.root.join("config/cable.yml")).exist? say "Enable redis in bundle" gemfile_content = File.read(Rails.root.join("Gemfile")) pattern = /gem ['"]redis['"]/ if gemfile_content.match?(pattern) uncomment_lines "Gemfile", pattern else append_file "Gemfile", "\n# Use Redis for Action Cable" gem 'redis', '~> 4.0' end run_bundle 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 the Turbo Streams broadcast feature.' end
Version data entries
29 entries across 29 versions & 2 rubygems