solid_cable 1.0.4 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 308be2095ff346a9b56b60f08d26adfabd2c2cfa24dbbf83f7e7df1a0b230b0e
4
- data.tar.gz: 2875794b63122cb4b11297de037c733d8c91969e1372c1ebfc68dfdf21e7d04d
3
+ metadata.gz: 6a3ffe8d513e578210ffa1586b9f3fa921919ab9ff1d4b2a9cbf802ea550a37c
4
+ data.tar.gz: 9dab848172317e0046d8beced7fe6f3e889b1190c91e5e9be10b2f6b964e6780
5
5
  SHA512:
6
- metadata.gz: 113f33268a0056e6233e3c4649f8a1acdbada127439ce47c1784e3c0f733ab7be68223f98b3f624ff7262ea21ec97a8480f52539995430e6f745c2075fca34ad
7
- data.tar.gz: d153dfb2ac483315464cf2e3d4c870a4524c34ba48298e940511601ca9eae2d1ce07dcad5947426fcf3e4e9db2a694a4b6bd4f12cd854c1208384fa83707d59f
6
+ metadata.gz: 07f016353535c742c511d63dfc600d78e381963567b89ece4ba194b357e0c89bcc2633b40e1d8b7cd6c062ff27d15e316a3b8c99ed36f04cea6163e33d034dde
7
+ data.tar.gz: e6affe9d7b555a0892aae14092368d46392f7fcc6f563c7bce91353e3bae046a444dbc28148bc10a2ffbb08d0872aaf2e401a5bf5151ac9fa2d23c51e3b72df9
@@ -4,35 +4,47 @@ class SolidCable::InstallGenerator < Rails::Generators::Base
4
4
  source_root File.expand_path("templates", __dir__)
5
5
 
6
6
  def add_solid_errors_db_schema
7
- template "cable_schema.rb"
7
+ template "db/cable_schema.rb"
8
8
  end
9
9
 
10
10
  def configure_production_cable
11
11
  gsub_file("config/cable.yml",
12
- old_production_cable_config,
12
+ /production:\n(^\s*.*$\n){2,}/,
13
13
  new_production_cable_config)
14
14
  end
15
15
 
16
+ def configure_development_cable
17
+ gsub_file("config/cable.yml",
18
+ /development:\n\s*adapter: redis\n url: .*\n/,
19
+ new_development_cable_config)
20
+ end
21
+
16
22
  private
17
23
 
18
- def old_production_cable_config
24
+ def new_production_cable_config
19
25
  <<~YAML
20
26
  production:
21
- adapter: redis
22
- url: <%%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
23
- channel_prefix: <%= app_name %>_production
27
+ adapter: solid_cable
28
+ connects_to:
29
+ database:
30
+ writing: cable
31
+ reading: cable
32
+ polling_interval: 0.1.seconds
33
+ keep_messages_around_for: 1.day
24
34
  YAML
25
35
  end
26
36
 
27
- def new_production_cable_config
37
+ def new_development_cable_config
28
38
  <<~YAML
29
- production:
39
+ development:
30
40
  adapter: solid_cable
31
41
  connects_to:
32
42
  database:
33
43
  writing: cable
34
- polling_interval: 0.1.seconds
44
+ reading: cable
45
+ polling_interval: 1.second
35
46
  keep_messages_around_for: 1.day
47
+ silence_polling: true
36
48
  YAML
37
49
  end
38
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidCable
4
- VERSION = "1.0.4"
4
+ VERSION = "1.0.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_cable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Pezza
@@ -40,7 +40,7 @@ files:
40
40
  - lib/action_cable/subscription_adapter/solid_cable.rb
41
41
  - lib/generators/solid_cable/install/USAGE
42
42
  - lib/generators/solid_cable/install/install_generator.rb
43
- - lib/generators/solid_cable/install/templates/cable_schema.rb
43
+ - lib/generators/solid_cable/install/templates/db/cable_schema.rb
44
44
  - lib/solid_cable.rb
45
45
  - lib/solid_cable/engine.rb
46
46
  - lib/solid_cable/railtie.rb
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements: []
70
- rubygems_version: 3.5.17
70
+ rubygems_version: 3.5.18
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: Database-backed Action Cable backend.