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

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/turbo-rails-2.0.5/lib/install/turbo_needs_redis.rb
turbo-rails-2.0.6 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.5 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.4 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.3 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.2 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.1 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.0 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.0.pre.rc.3 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.0.pre.rc.2 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.0.pre.rc.1 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.0.pre.beta.4 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.0.pre.beta.3 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.0.pre.beta.2 lib/install/turbo_needs_redis.rb
turbo-rails-2.0.0.pre.beta.1 lib/install/turbo_needs_redis.rb
turbo-rails-1.5.0 lib/install/turbo_needs_redis.rb
turbo-rails-1.4.0 lib/install/turbo_needs_redis.rb
turbo-rails-1.3.3 lib/install/turbo_needs_redis.rb
turbo-rails-1.3.2 lib/install/turbo_needs_redis.rb
turbo-rails-1.3.1 lib/install/turbo_needs_redis.rb