anycable-rails-core 1.4.2 → 1.4.4

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: 713258efa713cd94cb2aa57891bf52f2483732f6e84b918a90d77924bc9d78e2
4
- data.tar.gz: 45151b26a79c7ab05ba42629fcbb2c64a147142a39fe8d9eaff54dbce3b905c6
3
+ metadata.gz: 62bc4f7d0aef85236e0ff6a983e2a8c2db681397a70dacc91c85bbd4662377e8
4
+ data.tar.gz: 20cae16d638d1c47a96d5b235350c156d5e98f597858f72c9acab35aba3b0f0f
5
5
  SHA512:
6
- metadata.gz: d98ee91a26f73b7e9ff7c60820211ddebf53566520903f6ca26be838f4c27fed6f0a2a36787fe3207b569f32881c83efd263517eaa71a5f74bdee00dd61c63ff
7
- data.tar.gz: e0a86e5ccbef6d7735f71663a5a9511dc9dd3a7a7df8fa1ffd4e3cccbf653184c0048cbbd22007f21614f4d78f30ee5aa4bb55b275964f1b9b690e3927c27069
6
+ metadata.gz: bbb7e9670097c6ee0ce230f1a8226ffe0449c2cf4556b84bf465638fef385140c0aadbf2378477e37d09969617e74c66acda8c3c1f0075280abdc1a32792da58
7
+ data.tar.gz: 3a5498a417a077468f7adc6638c31f7d92a304f541475957bc74233e674c9cc6fc010ce432c9699b0eba2d308c8c1aacb4d85a21a7da7f48f8773162ece3c3fd
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.4.4 (2024-03-08) 🌷
6
+
7
+ - Minor fixes
8
+
9
+ ## 1.4.3 (2023-12-13)
10
+
11
+ - Fix console logging in Rails 7.1 when the app's logger has no broadcast support. ([@palkan][])
12
+
5
13
  ## 1.4.2 (2023-10-15)
6
14
 
7
15
  - Print warning if the database pool size is less than RPC pool size. ([@palkan][])
@@ -5,9 +5,18 @@ require "action_cable/remote_connections"
5
5
  ActionCable::RemoteConnections::RemoteConnection.include(AnyCable::Rails::Connections::SerializableIdentification)
6
6
 
7
7
  ActionCable::RemoteConnections::RemoteConnection.prepend(Module.new do
8
- def disconnect(reconnect: true)
9
- # Legacy Action Cable functionality if case we're not fully migrated yet
10
- super() unless AnyCable::Rails.enabled?
11
- ::AnyCable.broadcast_adapter.broadcast_command("disconnect", identifier: identifiers_json, reconnect: reconnect)
8
+ # Rails <7.1 has no `reconnect` argument
9
+ if ActionCable::RemoteConnections::RemoteConnection.instance_method(:disconnect).arity == 0
10
+ def disconnect(reconnect: true)
11
+ # Legacy Action Cable functionality if case we're not fully migrated yet
12
+ super() unless AnyCable::Rails.enabled?
13
+ ::AnyCable.broadcast_adapter.broadcast_command("disconnect", identifier: identifiers_json, reconnect: reconnect)
14
+ end
15
+ else
16
+ def disconnect(reconnect: true)
17
+ # Legacy Action Cable functionality if case we're not fully migrated yet
18
+ super unless AnyCable::Rails.enabled?
19
+ ::AnyCable.broadcast_adapter.broadcast_command("disconnect", identifier: identifiers_json, reconnect: reconnect)
20
+ end
12
21
  end
13
22
  end)
@@ -33,8 +33,10 @@ module AnyCable
33
33
  # Rails 7.1+
34
34
  if AnyCable.logger.respond_to?(:broadcast_to)
35
35
  AnyCable.logger.broadcast_to(console)
36
- else
36
+ elsif ActiveSupport::Logger.respond_to?(:broadcast)
37
37
  AnyCable.logger.extend(ActiveSupport::Logger.broadcast(console))
38
+ elsif defined?(ActiveSupport::BroadcastLogger)
39
+ AnyCable.logger = ActiveSupport::BroadcastLogger.new(AnyCable.logger, console)
38
40
  end
39
41
  end
40
42
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AnyCable
4
4
  module Rails
5
- VERSION = "1.4.2"
5
+ VERSION = "1.4.4"
6
6
  end
7
7
  end
@@ -74,7 +74,7 @@ module AnyCableRailsGenerators
74
74
  answer = DEVELOPMENT_METHODS.index(options[:devenv]) || 99
75
75
 
76
76
  until DEVELOPMENT_METHODS[answer.to_i]
77
- answer = ask "Which environment do you use for development? (1) Local, (2) Docker, (0) Skip"
77
+ answer = ask "Do you want to run anycable-go locally or as a Docker container? (1) Local, (2) Docker, (0) Skip"
78
78
  end
79
79
 
80
80
  case env = DEVELOPMENT_METHODS[answer.to_i]
@@ -224,7 +224,8 @@ module AnyCableRailsGenerators
224
224
 
225
225
  def install_for_local
226
226
  inside("bin") do
227
- template "anycable-go", chmod: 0o755
227
+ template "anycable-go"
228
+ chmod "anycable-go", 0755, verbose: false # rubocop:disable Style/NumericLiteralPrefix
228
229
  end
229
230
 
230
231
  if file_exists?(".gitignore")
@@ -269,7 +270,7 @@ module AnyCableRailsGenerators
269
270
  end
270
271
 
271
272
  def anycable_go_version
272
- @anycable_go_version ||= (normalize_version(options[:version]) || "latest")
273
+ @anycable_go_version ||= normalize_version(options[:version]) || "latest"
273
274
  end
274
275
 
275
276
  def normalize_version(version)
@@ -4,6 +4,10 @@
4
4
  # Devise current user via `env["warden"].user`.
5
5
  #
6
6
  # See <%= DOCS_ROOT %>/ruby/authentication
7
- AnyCable::Rails::Rack.middleware.use Warden::Manager do |config|
8
- Devise.warden_config = config
7
+ #
8
+ # NOTE: This is only needed in environments where you use AnyCable.
9
+ if defined?(AnyCable::Rails)
10
+ AnyCable::Rails::Rack.middleware.use Warden::Manager do |config|
11
+ Devise.warden_config = config
12
+ end
9
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anycable-rails-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-16 00:00:00.000000000 Z
11
+ date: 2024-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anycable-core
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.4.8
127
+ rubygems_version: 3.4.20
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: AnyCable integration for Rails (w/o RPC dependencies)