anycable-rails 1.3.5 → 1.3.7

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: 75584d70f4f8d966a74cfee8d0741bc5072aabcbab60a7fecc2c4532d7a9719c
4
- data.tar.gz: a4efe6de0db26e8f91a896350a142aa483d9305798fafc3e758b29c522e7cf3a
3
+ metadata.gz: 60aa4eb7cba077db3f823f54b6c2f3e792ea5bdd1819c0e67a743e8feeb02fe2
4
+ data.tar.gz: 6ff7352202e587af57c80729f7b62b8316873b9e230a32cd802f217b76d90bab
5
5
  SHA512:
6
- metadata.gz: 64e79d37168a1d299d700cf86444e74e424a360b6d22fe6eb682ef0cba4ea648526a4ea603a5a032a709ed5308856df2d7cb8dedd634668afde239673ef89dd7
7
- data.tar.gz: aabcd20cbc91c4733d4978c9c99cf5d0574775badf9ef67fffea8a4a9b825c3b6e6b76c3581a4a75a3058f7ce3fb762a2b69dea4a8b2be935f0b75ea7e09fa0d
6
+ metadata.gz: befbe33cd332ef3f4be7b7eb754975bf38970d8cb67428e1ff68f72826da00b88c5b1ca203cee01433f5c3c197ec26148cdb8b2a0534afe93d48962055417b85
7
+ data.tar.gz: d6e97f87c28a15d07204bb4d78d371b66d982794156064ad12dc03c21a35dec41de48d0a7b433d079438fce6d89b940f9ff7feb856472f263083edb3dfe33d99
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.3.7 (2023-02-28)
6
+
7
+ - Fix `anycable` gem dependency constraints.
8
+
9
+ - Require Ruby 2.7+.
10
+
11
+ ## 1.3.6 (2023-02-28)
12
+
13
+ - Handle `nil` streams gracefully. ([@palkan][])
14
+
15
+ - Report exceptions via the `Rails.error.report` interface. ([@palkan][])
16
+
5
17
  ## 1.3.5 (2023-01-04)
6
18
 
7
19
  - Make misconfiguration error more informative. ([@palkan][])
@@ -25,6 +25,8 @@ ActionCable::Channel::Base.prepend(Module.new do
25
25
  def stream_from(broadcasting, _callback = nil, **)
26
26
  return super unless anycabled?
27
27
 
28
+ broadcasting = String(broadcasting)
29
+
28
30
  connection.anycable_socket.subscribe identifier, broadcasting
29
31
  end
30
32
 
@@ -45,6 +45,12 @@ module AnyCable
45
45
  # see https://github.com/rails/rails/pull/33469/files
46
46
  executor = app.config.reload_classes_only_on_change ? app.reloader : app.executor
47
47
  AnyCable.middleware.use(AnyCable::Rails::Middlewares::Executor.new(executor))
48
+
49
+ if app.executor.respond_to?(:error_reporter)
50
+ AnyCable.capture_exception do |ex, method, message|
51
+ ::Rails.error.report(ex, handled: false, context: {method: method, payload: message})
52
+ end
53
+ end
48
54
  end
49
55
 
50
56
  initializer "anycable.connection_factory", after: "action_cable.set_configs" do |app|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AnyCable
4
4
  module Rails
5
- VERSION = "1.3.5"
5
+ VERSION = "1.3.7"
6
6
  end
7
7
  end
@@ -159,6 +159,10 @@ module AnyCableRailsGenerators
159
159
  !!gemfile_lock&.match?(/^\s+redis\b/)
160
160
  end
161
161
 
162
+ def nats?
163
+ !!gemfile_lock&.match?(/^\s+nats-pure\b/)
164
+ end
165
+
162
166
  def webpacker?
163
167
  !!gemfile_lock&.match?(/^\s+webpacker\b/)
164
168
  end
@@ -12,17 +12,14 @@
12
12
  default: &default
13
13
  # Turn on/off access logs ("Started..." and "Finished...")
14
14
  access_logs_disabled: false
15
- # Persist "dirty" session between RPC calls (might be required for apps using stimulus_reflex <3.0)
16
- # persistent_session_enabled: true
17
- # This is the host and the port to run AnyCable RPC server on.
18
- # You must configure your WebSocket server to connect to it, e.g.:
19
- # $ anycable-go --rpc-host="<rpc hostname>:50051"
20
- rpc_host: "127.0.0.1:50051"
21
15
  # Whether to enable gRPC level logging or not
22
16
  log_grpc: false
23
17
  <%- if redis? -%>
24
18
  # Use Redis to broadcast messages to AnyCable server
25
19
  broadcast_adapter: redis
20
+ <%- elsif nats? -%>
21
+ # Use NATS to broadcast messages to AnyCable server
22
+ broadcast_adapter: nats
26
23
  <%- else -%>
27
24
  # Use HTTP adapter for a quick start (since redis gem is not present in the project)
28
25
  broadcast_adapter: http
@@ -44,7 +41,8 @@ test:
44
41
 
45
42
  production:
46
43
  <<: *default
47
- <%- if !redis? -%>
48
- # Use Redis in production
44
+ <%- if !redis? && !nats? -%>
45
+ # Use Redis or NATS in production
49
46
  broadcast_adapter: redis
47
+ # broadcast_adapter: nats
50
48
  <%- end -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anycable-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-04 00:00:00.000000000 Z
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anycable
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.0
19
+ version: 1.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.2.0
26
+ version: 1.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actioncable
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -198,14 +198,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - ">="
200
200
  - !ruby/object:Gem::Version
201
- version: '2.6'
201
+ version: '2.7'
202
202
  required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  requirements:
204
204
  - - ">="
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
207
  requirements: []
208
- rubygems_version: 3.3.11
208
+ rubygems_version: 3.4.6
209
209
  signing_key:
210
210
  specification_version: 4
211
211
  summary: Rails adapter for AnyCable